-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
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
TypeError in deprecated class because of arguments given to __new__ #4
Comments
This bug comes from function I'm not sure if the underlying problem comes from this library, so I'm not sure if this is really the best place to report this bug. On my system at least, I found a weird issue, where if you use a function like this: def new_constructor(cls, *args, **kwargs):
print(cls)
print(args)
print(kwargs)
SomeClass.__new__ = classmethod(new_constructor) It seems to call the def new_constructor(*args, **kwargs):
print(cls)
print(args)
print(kwargs)
SomeClass.__new__ = classmethod(new_constructor) works as expected. No idea why, this looks very strange... possibly an obscure issue with my system (?) |
I ended up working around this problem by using deprecated on the |
I need to investigate this issue further. |
This exception is raised when some parameters in passed to |
Here is a demonstration of the problem: class Something(object):
def __new__(cls, *args, **kwargs):
return super(Something, cls).__new__(cls, *args, **kwargs)
def __init__(self, a=5):
self.a = a
Something(5) You get:
Because |
…ass arguments to :meth:`object.__new__` (other than *cls*).
Expected Behavior
No exception, returns class as expected.
Actual Behavior
Not complete traceback but most important part:
Environment
The text was updated successfully, but these errors were encountered: