New submission from ppperry <[email protected]>:
> type(sys.flags).__new__(type(sys.flags))
Traceback (most recent call last):
File "<pyshell#102>", line 1, in <module>
type(sys.flags).__new__(type(sys.flags))
TypeError: tuple.__new__(sys.flags) is not safe, use sys.flags.__new__()
Ignoring the confusion caused by both the type and the instance being called
"sys.flags", this error doesn't make sense. I am using "sys.flags" (the
type).__new__, so why is it complaining?
"type(sys.flags)()" produces the standard "non-instantiable type" error.
The same behavior also happens for "sys.version_info", but strangely not for
any of the other sys constants.
----------
components: Interpreter Core, Library (Lib)
messages: 322688
nosy: ppperry
priority: normal
severity: normal
status: open
title: Nonsensical exception message when calling `__new__` on some sys objects
type: behavior
versions: Python 3.7, Python 3.8
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue34284>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com