[issue11455] issue a warning when populating a CPython type dict with non-string keys

Irit Katriel report at bugs.python.org
Wed Dec 1 11:36:05 EST 2021


Irit Katriel <iritkatriel at gmail.com> added the comment:

Reproduced on 3.11.

>>> A = type("A", (object,), {42: "abc"})
>>> dir(A())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: '<' not supported between instances of 'int' and 'str'

----------
nosy: +iritkatriel
type: behavior -> enhancement
versions: +Python 3.11 -Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue11455>
_______________________________________


More information about the Python-bugs-list mailing list