We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In 1.10.0, this fails with a TypeError:
TypeError
import lazy_object_proxy @lazy_object_proxy.Proxy def Base(): class Base: pass return Base class Derived(Base): pass
The problem is that class takes type(Base) to be Derived's metaclass, and calls it with three arguments, but Proxy.__init__ expects only one.
class
type(Base)
Derived
Proxy.__init__
Adding three metaclass methods to Proxy appears to fix the problem:
Proxy
class FixedProxy(lazy_object_proxy.Proxy): def __mro_entries__(self, bases): return (self.__wrapped__,) def __subclasscheck__(self, subclass): return issubclass(subclass, self.__wrapped__) def __instancecheck__(self, instance): return isinstance(instance, self.__wrapped__)
The text was updated successfully, but these errors were encountered:
I created a PR #82
Sorry, something went wrong.
No branches or pull requests
In 1.10.0, this fails with a
TypeError
:The problem is that
class
takestype(Base)
to beDerived
's metaclass, and calls it with three arguments, butProxy.__init__
expects only one.Adding three metaclass methods to
Proxy
appears to fix the problem:The text was updated successfully, but these errors were encountered: