-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed as duplicate
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
>>> type(print).__new__(type(print))
Traceback (most recent call last):
File "<python-input-0>", line 1, in <module>
type(print).__new__(type(print))
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
TypeError: object.__new__(builtin_function_or_method) is not safe, use builtin_function_or_method.__new__()
The type(print).__new__
is not object.__new__
, so the message is wrong. The correct message is "cannot create 'builtin_function_or_method' instances"
CPython versions tested on:
3.13
Operating systems tested on:
Windows
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error