MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / attrsetter

Function attrsetter

lib/sqlalchemy/util/langhelpers.py:2035–2039  ·  view source on GitHub ↗
(attrname)

Source from the content-addressed store, hash-verified

2033
2034
2035def attrsetter(attrname):
2036 code = "def set(obj, value): obj.%s = value" % attrname
2037 env = locals().copy()
2038 exec(code, env)
2039 return env["set"]
2040
2041
2042dunders_re = re.compile("^__.+__$")

Callers

nothing calls this directly

Calls 2

localsFunction · 0.85
copyMethod · 0.45

Tested by

no test coverage detected