You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Copy class namespace when using metaclass
* Fix preconditions for type constructor
* Improve handling of __classcell__
* Reorder class __doc__ and __module__
* Add tests
* Change nullabiliy of CallPrepare return type
* Pass __classcell__ tests from StdLib 3.6
* Move __classcell__ tests from test_class to test_super
withself.assertWarnsRegex(DeprecationWarning, r"^__class__ not set defining 'MyClass' as <class '.*\.MyClass'>\. Was __classcell__ propagated to type\.__new__\?$"):
2693
-
classMyDict(dict):
2694
-
def__setitem__(self, key, value):
2695
-
pass
2696
-
2697
-
classMetaClass(type):
2698
-
@classmethod
2699
-
def__prepare__(metacls, name, bases):
2700
-
returnMyDict()
2701
-
2702
-
classMyClass(metaclass=MetaClass):
2703
-
deftest(self):
2704
-
return__class__
2705
-
2706
-
self.assertEqual(len(ws), 0) # no unchecked warnings
2707
-
2708
-
withwarnings.catch_warnings(record=True) asws:
2709
-
warnings.simplefilter("always")
2710
-
2711
-
withself.assertWarnsRegex(DeprecationWarning, r"^__class__ not set defining 'bar' as <class '.*\.gez'>\. Was __classcell__ propagated to type\.__new__\?$"):
2712
-
classgez: pass
2713
-
2714
-
deffoo(*args):
2715
-
returngez
2716
-
2717
-
classbar(metaclass=foo):
2718
-
defbarfun(self):
2719
-
return__class__
2720
-
2721
-
self.assertEqual(len(ws), 0) # no unchecked warnings
2722
-
2723
2624
deftest_issubclass(self):
2724
2625
# first argument doesn't need to be new-style or old-style class if it defines __bases__
0 commit comments