Closed
Description
Bug report
def f(a, b):
return dict((k.lower(), v) for k, v in a.items()) == dict(
(k.lower(), v) for k, v in b.items()
)
f({"a": 5}, {1: 1})
output:
Traceback (most recent call last):
File "/home/frank/projects/executing/test8.py", line 8, in <module>
f({"a": 5}, {1: 1})
File "/home/frank/projects/executing/test8.py", line 2, in f
return dict((k.lower(), v) for k, v in a.items()) == dict(
^^^^^
File "/home/frank/projects/executing/test8.py", line 2, in <genexpr>
return dict((k.lower(), v) for k, v in a.items()) == dict(
^^^^^^^
AttributeError: 'int' object has no attribute 'lower'
The error should be reported at line 3 and not at line 2, because the integer is passed to b
Your environment
- current cpython 3.11 branch (3a33e9b)
- and the Python 3.11.0b4
Metadata
Metadata
Assignees
Labels
Projects
Status
Done