Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Bug report
Bug description:
Follow comment#132055 (comment)
fromwarningsimportdeprecated@deprecated("MyMeta will go away soon")classMyMeta(type):def__new__(mcs,name,bases,attrs,cls=None):returnsuper().__new__(mcs,name,bases,attrs)classFoo(metaclass=MyMeta,cls='haha'):pass
Output:
$python3 test.pyTraceback (most recent call last): File "/Users/PanXuehai/Projects/cpython/test.py", line 10, in <module> class Foo(metaclass=MyMeta, cls='haha'): passTypeError: MyMeta.__new__() got multiple values for argument 'cls'
CPython versions tested on:
3.13
Operating systems tested on:
macOS