Files
openide/python/testData/refactoring/changeSignature/otherDunderNewInHierarchyNotModified.after.py
Mikhail Golubev 8487b4cf70 PY-22023 Don't try to update subclasses' constructors in Change Signature
Accordingly, don't ask to modify "overridden" constructor of a base class.
Unlike other methods, constructors in the hierarchy usually don't mean to
have identical signatures, thus it's not safe to blindly sync them this way.

GitOrigin-RevId: 61e300914831c726afea3928acd110fea8428df8
2020-04-17 12:46:38 +00:00

16 lines
302 B
Python

class Super:
def __new__(cls):
return super().__new__(cls)
class Target(Super):
def __new__(cls, foo, bar):
print(foo)
return super().__new__(cls)
class Sub(Target):
def __new__(cls, foo, extra):
print(extra)
return super().__new__(cls, foo, 42)