This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author alexmojaki
Recipients Mark.Shannon, alexmojaki, aroberge
Date 2021-07-07.11:38:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1625657906.41.0.218315309532.issue44576@roundup.psfhosted.org>
In-reply-to
Content
I believe this is the outcome of https://bugs.python.org/issue39316 which I filed, so I'm pulling in . Naturally I think the new behaviour is not a bug but a feature.

I think it's more important for the traceback to show the attribute access (`two`) than the value (`one`). That's what the frame was doing at the time which led to the error.

The difference becomes even more important when calling a method with no arguments. Given this script:

class A:
    def b(self):
        1 / 0


x = (
    A()
        .b()
)


The 3.9 traceback points to the line with `A()` in the `<module>` frame, while 3.10 correctly points to `.b()`, which makes the following line 'in b' make more sense.

Where the old behaviour has really gotten to me is when I run the pycharm debugger and put a breakpoint on the .b() line and it never gets hit. Not being sure what lines 'count', I sometimes defensively put breakpoints on a cluster of lines, then spend more time removing them later. Having that fixed in 3.10 is great.
History
Date User Action Args
2021-07-07 11:38:26alexmojakisetrecipients: + alexmojaki, aroberge, Mark.Shannon
2021-07-07 11:38:26alexmojakisetmessageid: <1625657906.41.0.218315309532.issue44576@roundup.psfhosted.org>
2021-07-07 11:38:26alexmojakilinkissue44576 messages
2021-07-07 11:38:26alexmojakicreate