The Real Python Podcast

Creating Better Error Messages for Python 3.10 & 3.11


Listen Later

What goes into creating those enhanced error messages in the latest versions of Python? How does the new PEG parser help to pinpoint where errors have occurred? This week on the show, Pablo Galindo Salgado talks about the work that goes into creating these improvements.

Pablo is a core CPython developer and is the release manager for Python versions 3.10 and 3.11. He is also serving his second term on the Python Steering Council.

Pablo is pleasantly surprised by the positive feedback for the new error messages in Python 3.10. He shares some of the upcoming enhancements for 3.11. We talk about how the new PEG parser allows for greater context when defining errors and pinpointing where they occur.

We talk about how he started contributing to CPython. He also shares some of the programming experiences he had while studying physics at university.

Course Spotlight: Starting With Linear Regression in Python

In this video course, you’ll get started with linear regression in Python. Linear regression is one of the fundamental statistical and machine learning techniques, and Python is a popular choice for machine learning.

Topics:

  • 00:00:00 – Introduction
  • 00:01:56 – Member of the Python Steering Council
  • 00:02:40 – Physics background and research use of Python
  • 00:08:43 – How did you get involved in core development?
  • 00:10:27 – Why did you take on the role of release manager?
  • 00:13:38 – What challenges have you found along the way?
  • 00:19:08 – Sponsor: LinearB
  • 00:19:48 – What motivated you to add enhanced error messages?
  • 00:29:33 – How does the PEG parser help in these situations?
  • 00:37:04 – PEG parser and infinite lookahead
  • 00:40:58 – Identifying where the syntax is wrong
  • 00:43:28 – Finding where a comma is missing
  • 00:48:49 – Is this a dictionary missing a colon, or is it a set?
  • 00:50:19 – Identifying missing portions of a try … except block
  • 00:51:44 – Video Course Spotlight
  • 00:53:00 – Informing library maintainers and not slowing performance
  • 00:56:18 – Enhanced error messages coming in 3.11
  • 01:06:38 – Real Python preview of Python 3.11
  • 01:07:28 – What are you excited about in the world of Python?
  • 01:13:00 – What do you want to learn next?
  • 01:15:43 – How to contribute to the project?
  • 01:20:24 – Thanks and goodbye
  • Show Links:

    • PEP 8016 – The Steering Council Model | peps.python.org
    • Fortran Programming Language
    • Wolfram Mathematica: Modern Technical Computing
    • C (programming language) - Wikipedia
    • Mare Nostrum, The Temple Of The Bit | WIRED
    • Python Insider: Python 3.10.4 and 3.9.12 are now available out of schedule
    • PEP 657 – Include Fine Grained Error Locations in Tracebacks | peps.python.org
    • Python 3.11 Preview: Even Better Error Messages – Real Python
    • friendly-traceback: Friendlier Python tracebacks.
    • IPython - Interactive Computing
    • Coverage.py - Documentation
    • faster-cpython/ideas - presentation pdf · GitHub
    • PEP 659 – Specializing Adaptive Interpreter | peps.python.org
    • How to Sweep Pick: 14 Steps (with Pictures) - wikiHow
    • Line 6 - Shuriken Variax Guitar
    • Talks: Making Python Better One Error Message at a Time PyCon 2022
    • Python Developer’s Guide
    • Guide to CPython’s Parser - Python Developer’s Guide
    • pablogsal (Pablo Galindo Salgado) · GitHub
    • Pablo Galindo Salgado (@pyblogsal) / Twitter
    • Level up your Python skills with our expert-led courses:

      • Cool New Features in Python 3.10
      • Starting With Linear Regression in Python
      • Raising and Handling Python Exceptions
      • Support the podcast & join our community of Pythonistas

        ...more
        View all episodesView all episodes
        Download on the App Store

        The Real Python PodcastBy Real Python

        • 4.7
        • 4.7
        • 4.7
        • 4.7
        • 4.7

        4.7

        136 ratings


        More shows like The Real Python Podcast

        View all
        Software Engineering Radio - the podcast for professional software developers by se-radio@computer.org

        Software Engineering Radio - the podcast for professional software developers

        272 Listeners

        The Changelog: Software Development, Open Source by Changelog Media

        The Changelog: Software Development, Open Source

        283 Listeners

        Thoughtworks Technology Podcast by Thoughtworks

        Thoughtworks Technology Podcast

        41 Listeners

        Talk Python To Me by Michael Kennedy

        Talk Python To Me

        592 Listeners

        Software Engineering Daily by Software Engineering Daily

        Software Engineering Daily

        624 Listeners

        Soft Skills Engineering by Jamison Dance and Dave Smith

        Soft Skills Engineering

        269 Listeners

        Super Data Science: ML & AI Podcast with Jon Krohn by Jon Krohn

        Super Data Science: ML & AI Podcast with Jon Krohn

        298 Listeners

        Python Bytes by Michael Kennedy and Brian Okken

        Python Bytes

        213 Listeners

        Data Engineering Podcast by Tobias Macey

        Data Engineering Podcast

        142 Listeners

        Syntax - Tasty Web Development Treats by Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers

        Syntax - Tasty Web Development Treats

        982 Listeners

        DataFramed by DataCamp

        DataFramed

        266 Listeners

        Kubernetes Podcast from Google by Abdel Sghiouar, Kaslin Fields

        Kubernetes Podcast from Google

        181 Listeners

        Practical AI by Practical AI LLC

        Practical AI

        189 Listeners

        The Stack Overflow Podcast by The Stack Overflow Podcast

        The Stack Overflow Podcast

        64 Listeners

        The Pragmatic Engineer by Gergely Orosz

        The Pragmatic Engineer

        52 Listeners