The Real Python Podcast

Common Python Stumbling Blocks & Quirky Behaviors


Listen Later

Have you ever encountered strange behavior when trying something new in Python? What are common quirks hiding within the language? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects.

We discuss a recent blog post that lists a collection of quirky Python behaviors. We share a few examples with explanations but leave several as puzzles to dig into.

Christopher transitions our discussion into Python features that can be difficult to explain to a new programmer. We also share some of our own stumbling blocks while learning the language.

We cover several other articles and projects from the Python community, including a news update, previewing Python 3.12’s more intuitive and consistent f-strings, finding performance bottlenecks with profiling, emulating the 6502 processor in Python, using Rich to inspect Python objects, and plotting statistical data with Lets-Plot.

This week’s episode is brought to you by Porkbun.

Course Spotlight: Graph Your Data With Python and ggplot

In this course, you’ll learn how to use ggplot in Python to build data visualizations with plotnine. You’ll discover what a grammar of graphics is and how it can help you create plots in a very concise and consistent way.

Topics:

  • 00:00:00 – Introduction
  • 00:02:12 – Steering Council Announces Optional GIL
  • 00:04:05 – Polars is Starting a Company
  • 00:05:13 – Python 3.12 Preview: More Intuitive and Consistent F-Strings
  • 00:09:29 – Sponsor: Porkbun
  • 00:10:22 – Profiling in Python: How to Find Performance Bottlenecks
  • 00:21:01 – Writing a 6502 Emulator in Python
  • 00:24:36 – Python Quirks
  • 00:32:30 – Video Course Spotlight
  • 00:34:02 – What Python feature would you have trouble explaining to a new programmer?
  • 00:42:25 – Using Rich Inspect to Interrogate Python Objects
  • 00:44:36 – Lets-Plot: Plotting Library for Statistical Data
  • 00:48:01 – Thanks and goodbye
  • News:

    • Steering Council Announces Optional GIL
    • Polars is Starting a Company
    • Show Links:

      • Python 3.12 Preview: More Intuitive and Consistent F-Strings – In this tutorial, you’ll preview one of the upcoming features of Python 3.12, which introduces a new f-string syntax formalization and implementation. The new implementation lifts some restrictions and limitations that affect f-string literals in Python versions lower than 3.12.
      • Profiling in Python: How to Find Performance Bottlenecks – In this tutorial, you’ll learn how to profile your Python programs using numerous tools available in the standard library, third-party libraries, as well as a powerful tool foreign to Python. Along the way, you’ll learn what profiling is and cover a few related concepts.
      • Writing a 6502 Emulator in Python – The 6502 processor from Motorola was quite popular and could be found in the Nintendo and Sega consoles as well as the Commodore 64. This very detailed article shows you how to build an emulator for the processor in Python.
      • Python Quirks – A straight-out list of code snippets showing off some of the weird and unexpected behavior of your favorite language.
      • Discussion

        • What Python feature would you have trouble explaining to a new programmer? - Trey Hunner on Twitter
        • Projects:

          • Using Rich Inspect to Interrogate Python Objects – You might know the Rich library as the terminal color tool, but it has a few utilities that are generally helpful in your code. This article shows you the inspect feature, which gives you loads of information on an object.
          • Lets-Plot: Plotting Library for Statistical Data
          • Additional Links:

            • Polars
            • Python 3.12 Preview: Support For the Linux perf Profiler – Real Python
            • Python Timer Functions: Three Ways to Monitor Your Code – Real Python
            • Episode #128: Using a Memory Profiler in Python & What It Can Teach You – The Real Python Podcast
            • Defining Your Own Python Function – Mutable Default Parameters
            • Level up your Python skills with our expert-led courses:

              • Using Jupyter Notebooks
              • Creating Web Maps From Your Data With Python Folium
              • Graph Your Data With Python and ggplot
              • 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

                134 ratings


                More shows like The Real Python Podcast

                View all
                Hanselminutes with Scott Hanselman by Scott Hanselman

                Hanselminutes with Scott Hanselman

                377 Listeners

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

                Software Engineering Radio - the podcast for professional software developers

                265 Listeners

                The Changelog: Software Development, Open Source by Changelog Media

                The Changelog: Software Development, Open Source

                287 Listeners

                LINUX Unplugged by Jupiter Broadcasting

                LINUX Unplugged

                262 Listeners

                Thoughtworks Technology Podcast by Thoughtworks

                Thoughtworks Technology Podcast

                41 Listeners

                Talk Python To Me by Michael Kennedy

                Talk Python To Me

                584 Listeners

                Software Engineering Daily by Software Engineering Daily

                Software Engineering Daily

                628 Listeners

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

                Super Data Science: ML & AI Podcast with Jon Krohn

                294 Listeners

                Python Bytes by Michael Kennedy and Brian Okken

                Python Bytes

                213 Listeners

                Data Engineering Podcast by Tobias Macey

                Data Engineering Podcast

                140 Listeners

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

                Syntax - Tasty Web Development Treats

                988 Listeners

                CoRecursive: Coding Stories by Adam Gordon Bell - Software Developer

                CoRecursive: Coding Stories

                186 Listeners

                DataFramed by DataCamp

                DataFramed

                269 Listeners

                Practical AI by Practical AI LLC

                Practical AI

                190 Listeners

                The Stack Overflow Podcast by The Stack Overflow Podcast

                The Stack Overflow Podcast

                63 Listeners