[issue36827] Overriding __new__ method with itself changes behaviour of the class
Alexey Muranov
report at bugs.python.org
Tue May 7 08:22:06 EDT 2019
Alexey Muranov <alexey.muranov at gmail.com> added the comment:
The issue is the following: i expect overriding a method with itself to not change behaviour of the class. I do not see how my understanding of `__new__` or its point could be relevant.
Do we agree that overriding a method with itself should not change behaviour? Is there a more correct way to do it than
def foo(self, *args, **kwarg):
# possible extensions
# ...
super(__class__, self).foo(*args, **kwarg)
(modified accordingly for class and static methods)?
When I do not override `__new__`, I expect Python to use `object`'s `__new__` (or at least pretend that it does). Therefore there should be no difference in behaviour.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36827>
_______________________________________
More information about the Python-bugs-list
mailing list