[issue32448] subscriptable

R. David Murray report at bugs.python.org
Fri Dec 29 15:00:00 EST 2017


R. David Murray <rdmurray at bitdance.com> added the comment:

At the point at which that error is raised, Python doesn't know the name of the attribute, nor is attribute access the only place where that particular error report is triggered (it's in a generic subscript-this-object call).  So I doubt doing this would be practical.

As for Foo.organizer.blah[0], it has to be blah that is None, since '.organizer' is an attribute access and not a subscript operation.  The more difficult case is something like getattr(someobject, somevar)[0], where you can't tell what somevar contains just from the traceback.  Which is why some value-added systems also dump the locals from the frame in the traceback.

----------
nosy: +r.david.murray

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


More information about the Python-bugs-list mailing list