News for hackers. Stuff that matters.
Re:Python 3.11 vs 3.10 performance by dec0dedab0de on Wednesday July 06, 2022 @02:39PM (#32005035)
This is the first time I ever heard someone complain about Python's error messages in the 10+ years I've been using it. Even people who just learned it, pick up reading tracebacks after about a day of practice. The only problem I ever see is if a library swallows too much, and gives a generic error, but that's not something the language can fix. I really hope they don't change things too much.
Re:Python 3.11 vs 3.10 performance by joshmaker on Wednesday July 06, 2022 @03:42PM (#32005829)
The new error messages are much better. Take a look at this example:

  Traceback (most recent call last):
    File "calculation.py", line 54, in <module>
      result = (x / y / z) * (a / b / c)
                ~~~~~~^~~
  ZeroDivisionError: division by zero

In this new version it's now obvious which variable is causing the 'division by zero' error.

https://docs.python.org/3.11/whatsnew/3.11.html#enhanced-err...

Re:Python 3.11 vs 3.10 performance by bredren on Wednesday July 06, 2022 @06:27PM (#32007660)
For a lot of folks dealing with getting something working, its way more useful to have the most likely spot where the error is occurring spit out for them like this.

Stack trace is useful, especially in understanding how the code is working in the system.

But if the goal is solve the problem with the code you've been working on, existing traces are way too verbose and if anything add noise or distract from getting to productive again.

I could see tracebacks get swifty terminal UI that shows only the pinpointed error point that can be accordion'd out to show the rest.

Re:Python 3.11 vs 3.10 performance by dx034 on Thursday July 07, 2022 @02:38AM (#32010637)
You've clearly been working with the right people. I constantly get screenshots of error messages (not even the text of the traceback so that I could copy it) with questions about what that means. It takes some training for people to be able to read tracebacks correctly, especially if they have no other programming experience.
Re:Python 3.11 vs 3.10 performance by e-master on Wednesday July 06, 2022 @06:32PM (#32007723)
I only rarely delve into the python world, but as a .net developer I always found it odd and confusing that the error message comes after the stack trace in python. I don’t see people complaining about it, so maybe it’s just a matter of habit?
Re:Python 3.11 vs 3.10 performance by kzrdude on Wednesday July 06, 2022 @07:23PM (#32008133)
I guess it's just a habit even if I think it's mildly confusing too.

But: it's kind of a virtue that the most important error message comes last. Far too many (ahead of time) compilers output too many errors. The most likely error to matter is the first one, but it is often scrolled way off screen; the following errors might even just be side effects that mislead or confuse the new users.

Re:Python 3.11 vs 3.10 performance by AdamN on Thursday July 07, 2022 @09:12AM (#32013646)
On the CLI, you'll see the error just above the prompt and then the stack trace above that. It makes sense since the user is always reading up the terminal in reverse order.
Re:Python 3.11 vs 3.10 performance by actuallyalys on Wednesday July 06, 2022 @05:07PM (#32006846)
I don’t think they’re that bad, but I think the bar has (fortunately) become higher.
Re:Python 3.11 vs 3.10 performance by urthor on Wednesday July 06, 2022 @11:07PM (#32009513)
Exactly right.

The old Python stack trace, circa 2015, was the best in the world.

The new ones are even better.

The gap between Python and Rust, and the JVM languages/C/C++, is increasingly widening.

Stack trace is one of the areas Python and Rust are making the case for why they're the languages of the future.