wrapt icon indicating copy to clipboard operation
wrapt copied to clipboard

hasattr returns different results for proxied objects

Open chadrik opened this issue 9 years ago • 0 comments

Duck-typing relies pretty heavily on hasattr checks, so this difference in behavior could cause problems. e.g.:

from wrapt import ObjectProxy
assert hasattr(ObjectProxy(1), '__contains__') == hasattr(1, '__contains__')

For the record, lazy_object_proxy suffers the same problem but ProxyTypes does not.

chadrik avatar Oct 27 '16 17:10 chadrik