summaryrefslogtreecommitdiffstatshomepage
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/basics/class_new.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/basics/class_new.py b/tests/basics/class_new.py
index 7fedcab6c2..7e84dccf40 100644
--- a/tests/basics/class_new.py
+++ b/tests/basics/class_new.py
@@ -1,6 +1,4 @@
class A:
-
- @staticmethod
def __new__(cls):
print("A.__new__")
return super(cls, A).__new__(cls)
@@ -9,13 +7,21 @@ class A:
pass
def meth(self):
- pass
+ print('A.meth')
#print(A.__new__)
#print(A.__init__)
a = A()
+a.meth()
+
+a = A.__new__(A)
+a.meth()
#print(a.meth)
#print(a.__init__)
#print(a.__new__)
+
+# __new__ should automatically be a staticmethod, so this should work
+a = a.__new__(A)
+a.meth()