File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -265,3 +265,20 @@ class B: pass
265265
266266class C (* (A , B ), ** {"metaclass" : type }):
267267 pass
268+
269+ class A (type ):
270+ def __new__ (mcls ):
271+ assert type (mcls .__new__ ).__name__ == 'function'
272+ assert type (mcls .mro ).__name__ == 'method_descriptor'
273+ assert type (super ().__new__ ).__name__ in ['builtin_function_or_method' , 'method' ]
274+ assert type (super ().mro ).__name__ == 'method_descriptor'
275+
276+ class B (type ):
277+ def x (self ):
278+ assert type (self .__new__ ).__name__ in ['builtin_function_or_method' , 'method' ]
279+ assert type (self .mro ).__name__ in ['builtin_function_or_method' , 'method' ]
280+ assert type (super ().__new__ ).__name__ in ['builtin_function_or_method' , 'method' ]
281+ assert type (super ().mro ).__name__ in ['builtin_function_or_method' , 'method' ]
282+
283+ A ()
284+ B ('x' , (int ,), {}).x ()
You can’t perform that action at this time.
0 commit comments