wrapt
wrapt copied to clipboard
hasattr returns different results for proxied objects
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.