Python Bytes

#479 Talking About Types


Listen Later

Topics covered in this episode:
  • httpxyz one month in
  • Learn concurrency - a deep dive into multithreading with Python
  • pip 26.1 - lockfiles and dependency cooldowns
  • Python 3.15 sentinal values from PEP 661
  • Extras
  • Joke
  • Watch on YouTube

    About the show

    Sponsored by us! Support our work through:

    • Our courses at Talk Python Training
    • The Complete pytest Course
    • Patreon Supporters
    • Connect with the hosts

      • Michael: @[email protected] / @mkennedy.codes (bsky)
      • Brian: @[email protected] / @brianokken.bsky.social
      • Show: @[email protected] / @pythonbytes.fm (bsky)
      • Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 11am PT. Older video versions available there too.

        Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it.

        Michael #1: httpxyz one month in

        • First version of httpxyz contained just the fixes to get zstd working, and the fixes to get the test suite running on python 3.14, some ‘housekeeping’ changes related to the renaming
        • End of March: a compatibility shim that allows you to use httpxyz even with third-party packages that import httpx themselves, as long as you import httpxyz first.
          • Importing httpxyz automatically registers it under the httpx name in sys.modules , see https://httpxyz.org/httpx-compatibility/
          • Fixed a WHOLE bunch of performance related issues by forking httpcore
          • Brian #2: Learn concurrency - a deep dive into multithreading with Python

            • Nikos Vaggalis
            • “Whenever you are trying to speed up code using multiple cores, always ask yourself: “Do these threads need to talk to each other right now?” If the answer is yes, it will be slow. The best parallel code splits a big job into completely isolated chunks, processes them separately, and merges the results at the finish line.”
            • Good overview of thread concurrency with Python and how that’s been improved dramatically with free-threaded Python
            • Defines lots of terms you come across, including “embarrassingly parallel multithreading”
            • There’s a counter example that’s nice
              • Start with a shared resource, a counter, and multiple threads updating it
              • Attempt to fix with threading.Lock(), which fixes it, but slows things down
              • Good explanation of why
              • Proper fix with concurrent.futures and separating the work of different threads so that they can be independent and their results can be combined when they’re all finished.
              • Michael #3: pip 26.1 - lockfiles and dependency cooldowns

                • Python 3.9 is no longer supported
                • Experimental: installing from pylock files
                • Dependency cooldowns (see my post about this)
                • Lifting several 2020 resolver limitations
                • Brian #4: Python 3.15 sentinal values from PEP 661

                  MISSING = sentinel("MISSING")
                  def next_value(default: int | MISSING = MISSING):
                  ...
                  if default is MISSING:
                  ...
                  • Take a name str as a constructor parameter
                  • Intended to be compared with is operator, similar to None
                  • Sentinal objects can be used as a type, also similar to None
                    • and can be combined with other types with |.
                    • Unlike None, sentinal values are truthy. (Elipses ... are also truthy)
                      • This seems like a strange choice. but I guess it must have made sense to someone.
                      • It does force you to use is instead of depending on False-ness, so I guess it’ll make code using sentinels more readable.
                      • Interesting that the PEP was started in 2021, and we’re finally getting it this year.
                      • Extras

                        Brian:

                        • Before GitHub - Armin Ronacher
                        • tenacity - cross-platform multi-track audio editor/recorder
                          • learned about it from Armin’s article
                          • Joke:

                            • Joke option Make it myself
                              • Seems similar to what people think about software now
                              • Links

                                • httpxyz one month in
                                • httpxyz.org/httpx-compatibility
                                • Learn concurrency - a deep dive into multithreading with Python
                                • pip 26.1 - lockfiles and dependency cooldowns
                                • my post about this
                                • Python 3.15 sentinal values from PEP 661
                                • Before GitHub
                                • tenacity
                                • Make it myself
                                • ...more
                                  View all episodesView all episodes
                                  Download on the App Store

                                  Python BytesBy Michael Kennedy and Brian Okken

                                  • 4.7
                                  • 4.7
                                  • 4.7
                                  • 4.7
                                  • 4.7

                                  4.7

                                  212 ratings


                                  More shows like Python Bytes

                                  View all
                                  The Changelog: Software Development, Open Source by Changelog Media

                                  The Changelog: Software Development, Open Source

                                  288 Listeners

                                  The a16z Show by Andreessen Horowitz

                                  The a16z Show

                                  1,105 Listeners

                                  Daily Tech News Show by Tom Merritt

                                  Daily Tech News Show

                                  1,391 Listeners

                                  Software Engineering Daily by Software Engineering Daily

                                  Software Engineering Daily

                                  626 Listeners

                                  Talk Python To Me by Michael Kennedy

                                  Talk Python To Me

                                  583 Listeners

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

                                  Super Data Science: ML & AI Podcast with Jon Krohn

                                  306 Listeners

                                  NVIDIA AI Podcast by NVIDIA

                                  NVIDIA AI Podcast

                                  343 Listeners

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

                                  Syntax - Tasty Web Development Treats

                                  985 Listeners

                                  Tech Brew Ride Home by Morning Brew

                                  Tech Brew Ride Home

                                  964 Listeners

                                  Practical AI by Practical AI LLC

                                  Practical AI

                                  212 Listeners

                                  The Real Python Podcast by Real Python

                                  The Real Python Podcast

                                  140 Listeners

                                  No Priors: Artificial Intelligence | Technology | Startups by Conviction

                                  No Priors: Artificial Intelligence | Technology | Startups

                                  150 Listeners

                                  Latent Space: The AI Engineer Podcast by Latent.Space

                                  Latent Space: The AI Engineer Podcast

                                  101 Listeners

                                  This Day in AI Podcast by Michael Sharkey, Chris Sharkey

                                  This Day in AI Podcast

                                  228 Listeners

                                  The AI Daily Brief: Artificial Intelligence News and Analysis by Nathaniel Whittemore

                                  The AI Daily Brief: Artificial Intelligence News and Analysis

                                  688 Listeners