diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-02-12 22:20:47 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-02-12 22:20:47 -0500 |
commit | 838d78af711ccda918a702e01b5630b787cec453 (patch) | |
tree | 8d5c94ce0245eb6270efd227832f3bf6d96d1106 /lib/sqlalchemy/util/langhelpers.py | |
parent | 53aab63b6c24dfdcc249ada5c9d712dc42e5ae40 (diff) | |
download | sqlalchemy-838d78af711ccda918a702e01b5630b787cec453.tar.gz |
- Fixed bug whereby Session.merge() would call the
load() event with one too few arguments.
[ticket:2053]
- Added logic which prevents the generation of
events from a MapperExtension or SessionExtension
from generating do-nothing events for all the methods
not overridden. [ticket:2052]
Diffstat (limited to 'lib/sqlalchemy/util/langhelpers.py')
-rw-r--r-- | lib/sqlalchemy/util/langhelpers.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/sqlalchemy/util/langhelpers.py b/lib/sqlalchemy/util/langhelpers.py index 4088e85cb..7a7713d1e 100644 --- a/lib/sqlalchemy/util/langhelpers.py +++ b/lib/sqlalchemy/util/langhelpers.py @@ -323,6 +323,16 @@ def monkeypatch_proxied_specials(into_cls, from_cls, skip=None, only=None, pass setattr(into_cls, method, env[method]) + +def methods_equivalent(meth1, meth2): + """Return True if the two methods are the same implementation.""" + + # Py3k + #return getattr(meth1, '__func__', meth1) is getattr(meth2, '__func__', meth2) + # Py2K + return getattr(meth1, 'im_func', meth1) is getattr(meth2, 'im_func', meth2) + # end Py2K + def as_interface(obj, cls=None, methods=None, required=None): """Ensure basic interface compliance for an instance or dict of callables. |