-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Closed
Labels
3.11only security fixesonly security fixes3.12only security fixesonly security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)release-blockertriagedThe issue has been accepted as valid by a triager.The issue has been accepted as valid by a triager.type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
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
3.11only security fixesonly security fixes3.12only security fixesonly security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)release-blockertriagedThe issue has been accepted as valid by a triager.The issue has been accepted as valid by a triager.type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
Status
Done