[Sqlalchemy-tickets] Issue #3218: __module__ should be set on functions returned by public_factory?
Brought to you by:
zzzeek
|
From: Steven W. <iss...@bi...> - 2014-10-02 15:59:40
|
New issue 3218: __module__ should be set on functions returned by public_factory? https://bitbucket.org/zzzeek/sqlalchemy/issue/3218/__module__-should-be-set-on-functions Steven Winfield: This would be more in line with what functools.wraps() does, and code introspection tools could then determine where the returned function is supposed to live. For example, if I do this: from sqlalchemy.orm import relationship ...then sphinx (in particular) will generate documentation for relationship as if it were defined in the module containing the import. I think the change is a one-liner - sqlalchemy/util/langhelpers.py before the return statement of public_factory (line 154): decorated.__module__ = "sqlalchemy" + location.rsplit(".", 1)[0] |