Files
openide/python/testData/resolve/InitOrNewReturnsInitWhenNewIsLast.py
Mikhail Golubev c38d178be5 PY-21220 Handle moved classes that contain both __init__ and __new__
I changed behavior of PyClassImpl#NameFinder processor, so that it
always tries to find an element with the first of the names passed to
its constructor. In particular, #findInitOrNew() returns __init__
unless there was only __new__ defined in the class. Otherwise its
behavior contradicts with the method's javadoc.
2016-11-22 17:50:21 +03:00

7 lines
125 B
Python

class MyClass(object):
def __init__(self):
self.x = 42
def __new__(cls):
return object.__new__(cls)