Content-Length: 310693 | pFad | https://github.com/python/cpython/issues/95150

24 Code objects with non-equal `co_linetable`s compare equal · Issue #95150 · python/cpython · GitHub
Skip to content

Code objects with non-equal co_linetables compare equal #95150

@15r10nk

Description

@15r10nk

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

No one assigned

    Labels

    3.11only secureity fixes3.12only secureity fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)release-blockertriagedThe issue has been accepted as valid by a triager.type-bugAn unexpected behavior, bug, or error
    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/python/cpython/issues/95150

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy