The Real Python Podcast

Surveying Comprehension Constructs & Python Parallelism Infighting


Listen Later

Have you embraced the use of comprehensions in your Python journey? Are you familiar with all the varieties of comprehension constructs? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects.

We discuss a recent article that surveys Python’s comprehensions and generators. This overview includes code snippets and the fundamentals of creating list, set, and dictionary comprehensions. We weigh the advantages of using a comprehension versus the more familiar for loops that they replace.

Christopher shares an article about how there may be infighting between the parallelism in your Python code and the parallelism within the libraries that you’re using. These complex system interactions can cause processing slowdowns and hard-to-trace bottlenecks.

We share several other articles and projects from the Python community, including a news roundup, a Python linter comparison, an overview of multiprocessing race conditions in Python, a discussion covering import statement styles, a project for WASM-powered Jupyter tools running in the browser, and a collection of easter eggs and jokes hidden inside Python itself.

Course Spotlight: Understanding Python List Comprehensions

Python list comprehensions make it easy to create lists while performing sophisticated filtering, mapping, and conditional logic on their members. In this course, you’ll learn when to use list comprehensions in Python and how to create them effectively.

Topics:

  • 00:00:00 – Introduction
  • 00:02:41 – PyPy v7.3.10 Release
  • 00:03:17 – Django Bugfix Release: 4.1.4
  • 00:03:28 – Python 3.11.1, 3.10.9, 3.9.16, 3.8.16, 3.7.16 Released
  • 00:03:56 – Python Linter Comparison 2022
  • 00:11:51 – Who Controls Parallelism? A Disagreement That Leads to Slower Code
  • 00:15:58 – Sponsor: InfluxDB
  • 00:16:47 – A Crash Course in Comprehensions and Generators
  • 00:24:23 – Multiprocessing Race Conditions in Python
  • 00:27:46 – Video Course Spotlight
  • 00:28:55 – What Style of import Statement Do You Use?
  • 00:36:54 – jupyterlite: WASM Powered Jupyter Running in the Browser
  • 00:40:35 – python-easter-eggs: Easter Eggs and Hidden Jokes in Python
  • 00:43:18 – PyCoder’s Weekly: Submit a Link
  • 00:43:46 – Thanks and goodbye
  • News:

    • PyPy v7.3.10 Release
    • Django Bugfix Release: 4.1.4
    • Python 3.11.1, 3.10.9, 3.9.16, 3.8.16, 3.7.16 Released
    • Show Links:

      • Python Linter Comparison 2022 – There are many linter choices for Python. This article covers a lot of them: Pylint, Pyflakes, Flake8, autopep8, Bandit, Prospector, Pylama, Pyroma, Black, Mypy, Radon, and mccabe.
      • Who Controls Parallelism? A Disagreement That Leads to Slower Code – In complex systems, there may be a fight between the parallelism in your code vs the parallelism in the libraries that you’re using. This fight can cause things to slow down. This article shows some examples and explores what you can do about the issue.
      • A Crash Course in Comprehensions and Generators – A great collection of code snippets that showcase the power and flexibility of list comprehensions, generators, and related constructs.
      • Multiprocessing Race Conditions in Python – A race condition happens when parallel tasks attempt to execute code at the same time and the results are dependent on order of execution. Finding race conditions can be challenging. This article gives some hints as to how to find the different kinds of race conditions when coding with the multiprocessing module.
      • Discussion:

        • What Style of import Statement Do You Use?
        • Using wildcard imports (from … import *) — Python Anti-Patterns documentation
        • Python import: Advanced Techniques and Tips – Real Python
        • Projects:

          • jupyterlite: WASM Powered Jupyter Running in the Browser
          • python-easter-eggs: Easter Eggs and Hidden Jokes in Python
          • Additional Links:

            • Episode #39: Generators, Coroutines, and Learning Python Through Exercises – The Real Python Podcast
            • How to Use Generators and yield in Python – Real Python
            • PyCoder’s Weekly: Submit a Link
            • Level up your Python skills with our expert-led courses:

              • Threading in Python
              • Understanding Python List Comprehensions
              • Python Generators 101
              • 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