Message397074
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. |
|
Date |
User |
Action |
Args |
2021-07-07 11:38:26 | alexmojaki | set | recipients:
+ alexmojaki, aroberge, Mark.Shannon |
2021-07-07 11:38:26 | alexmojaki | set | messageid: <1625657906.41.0.218315309532.issue44576@roundup.psfhosted.org> |
2021-07-07 11:38:26 | alexmojaki | link | issue44576 messages |
2021-07-07 11:38:26 | alexmojaki | create | |
|