The Real Python Podcast

Advice for Writing Maintainable Python Code


Listen Later

What are techniques for writing maintainable Python code? How do you make your Python more readable and easier to refactor? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects.

We discuss a recent article about writing code that is easy to maintain. We cover writing comments, creating meaningful names, avoiding magic numbers, and preparing code for your future self.

We also share several other articles and projects from the Python community, including release news, modifying the REPL, differences between Polars and pandas, generating realistic test data in Python, investigating quasars with Polars and marimo, creating simple meta tags for Django objects, and a GUI toolkit for grids of buttons.

Course Spotlight: Modern Python Linting With Ruff

Ruff is a blazing-fast, modern Python linter with a simple interface that can replace Pylint, isort, and Black—and it’s rapidly becoming popular.

Topics:

  • 00:00:00 – Introduction
  • 00:01:53 – PyTorch 2.9 Release
  • 00:02:38 – Django 6.0 Beta 1
  • 00:03:05 – Handy Python REPL Modifications
  • 00:11:06 – Polars vs pandas: What’s the Difference?
  • 00:17:55 – Faker: Generate Realistic Test Data in Python
  • 00:22:06 – Video Course Spotlight
  • 00:23:35 – Investigating Quasars With Polars and marimo
  • 00:27:37 – Writing Maintainable Code
  • 00:49:48 – buttonpad: GUI Toolkit for Grids of Buttons
  • 00:52:10 – django-snakeoil: Simple Meta Tags for Django Objects
  • 00:54:07 – Thanks and goodbye
  • News:

    • PyTorch 2.9 Release
    • Django 6.0 Beta 1
    • Show Links:

      • Handy Python REPL Modifications – Trey uses the the Python REPL a lot. In this post he shows you his favorite customizations to make the REPL even better.
      • Polars vs pandas: What’s the Difference? – Discover the key differences in Polars vs pandas to help you choose the right Python library for faster, more efficient data analysis.
      • Faker: Generate Realistic Test Data in Python – If you want to generate test data with specific types (bool, float, text, integers) and realistic characteristics (names, addresses, colors, emails, phone numbers, locations), Faker can help you do that.
      • Investigating Quasars With Polars and marimo – Learn to visualize quasar redshift data by building an interactive marimo dashboard using Polars, pandas, and Matplotlib. You’ll practice retrieving, cleaning, and displaying data in your notebook. You’ll also build interactive UI components that live-update visualizations in the notebook.
      • Discussion:

        • Writing Maintainable Code – “Maintainable code can easily be the difference between long-lived, profitable software, and short-lived money pits.” Read on to see just what maintainable code is and how to achieve it.
        • Projects:

          • buttonpad: GUI Toolkit for Grids of Buttons
          • django-snakeoil: Simple Meta Tags for Django Objects
          • Additional Links:

            • The Python Standard REPL: Try Out Code and Ideas Quickly – Real Python
            • pyrepl-hacks: Hacky extensions and helper functions for the new Python REPL
            • pandas - Python Data Analysis Library
            • Polars — DataFrames for the new era
            • Welcome to Faker’s documentation!
            • SOLID Principles: Improve Object-Oriented Design in Python – Real Python
            • The Pragmatic Programmer - Wikipedia
            • Level up your Python skills with our expert-led courses:

              • Modern Python Linting With Ruff
              • Design and Guidance: Object-Oriented Programming in Python
              • Investigating Quasar Data With Polars and Interactive marimo Notebooks
              • 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

                138 ratings


                More shows like The Real Python Podcast

                View all
                Software Engineering Radio by se-radio@computer.org

                Software Engineering Radio

                273 Listeners

                The Changelog: Software Development, Open Source by Changelog Media

                The Changelog: Software Development, Open Source

                292 Listeners

                Software Engineering Daily by Software Engineering Daily

                Software Engineering Daily

                623 Listeners

                Talk Python To Me by Michael Kennedy

                Talk Python To Me

                585 Listeners

                Thoughtworks Technology Podcast by Thoughtworks

                Thoughtworks Technology Podcast

                42 Listeners

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

                Super Data Science: ML & AI Podcast with Jon Krohn

                303 Listeners

                Python Bytes by Michael Kennedy and Brian Okken

                Python Bytes

                214 Listeners

                Data Engineering Podcast by Tobias Macey

                Data Engineering Podcast

                145 Listeners

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

                Syntax - Tasty Web Development Treats

                983 Listeners

                CoRecursive: Coding Stories by Adam Gordon Bell - Software Developer

                CoRecursive: Coding Stories

                189 Listeners

                DataFramed by DataCamp

                DataFramed

                268 Listeners

                Kubernetes Podcast from Google by Abdel Sghiouar, Kaslin Fields

                Kubernetes Podcast from Google

                182 Listeners

                Practical AI by Practical AI LLC

                Practical AI

                213 Listeners

                AWS Podcast by Amazon Web Services

                AWS Podcast

                201 Listeners

                The Stack Overflow Podcast by The Stack Overflow Podcast

                The Stack Overflow Podcast

                62 Listeners