-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Closed
Closed
Copy link
Labels
stdlibPython modules in the Lib dirPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
Follow comment #132055 (comment)
from warnings import deprecated
@deprecated("MyMeta will go away soon")
class MyMeta(type):
def __new__(mcs, name, bases, attrs, cls=None):
return super().__new__(mcs, name, bases, attrs)
class Foo(metaclass=MyMeta, cls='haha'):
pass
Output:
$ python3 test.py
Traceback (most recent call last):
File "/Users/PanXuehai/Projects/cpython/test.py", line 10, in <module>
class Foo(metaclass=MyMeta, cls='haha'):
pass
TypeError: MyMeta.__new__() got multiple values for argument 'cls'
CPython versions tested on:
3.13
Operating systems tested on:
macOS
Linked PRs
Metadata
Metadata
Assignees
Labels
stdlibPython modules in the Lib dirPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error