[New-bugs-announce] [issue44576] AttributeError: incorrect line identified in Python 3.10

Andre Roberge report at bugs.python.org
Wed Jul 7 05:23:56 EDT 2021


New submission from Andre Roberge <andre.roberge at gmail.com>:

Consider the following program

# example.py
one = 1
two = "two"
a = [one
    .
    two]

Running this program with Python versions before 3.10, yields the following traceback:

Traceback (most recent call last):
  File "C:\Users\andre\example.py", line 3, in <module>
    a = [one
AttributeError: 'int' object has no attribute 'two'

The line shown correctly includes the 'int' object. I have verified that this is the case for Python 3.6 to 3.9 inclusively.

However, with Python version 3.10.0b3, the following traceback is generated:

Traceback (most recent call last):
  File "C:\Users\andre\example.py", line 5, in <module>
    two]
AttributeError: 'int' object has no attribute 'two'

----------
messages: 397067
nosy: aroberge
priority: normal
severity: normal
status: open
title: AttributeError: incorrect line identified in Python 3.10
versions: Python 3.10

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


More information about the New-bugs-announce mailing list