Episode Details

Back to Episodes
Coding With namedtuple & Python's Dynamic Superpowers

Coding With namedtuple & Python's Dynamic Superpowers

Episode 149 Published 3 years, 1 month ago
Description

Have you explored Python’s collections module? Within it, you’ll find a powerful factory function called namedtuple(), which provides multiple enhancements over the standard tuple for writing clearer and cleaner code. This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects.

Christopher discusses his Real Python video course about writing more Pythonic code using namedtuple(). With namedtuple(), you can create immutable sequence types that allow you to access their values using descriptive field names and dot notation instead of clunky integer indices.

We also discuss metaprogramming and the unique advantages of Python’s dynamism. Christopher shares potential paths for this type of coding from web applications, testing, and AST techniques.

We share several other articles and projects from the Python community, including a news update, the Arrow revolution happening in pandas 2.0, a new PEP for inlined comprehensions, tips and techniques for modern Flask apps, a Python helper tool for building and running a REPL with custom commands, and a project to turn a pandas DataFrame into a Tableau-style UI.

Topics:

  • 00:00:00 – Introduction
  • 00:02:17 – Python 3.12.0 alpha 6 released
  • 00:02:40 – Django Developers Survey 2022 Results
  • 00:03:12 – Writing Clean, Pythonic Code With namedtuple
  • 00:07:40 – pandas 2.0 and the Arrow Revolution (Part I)
  • 00:17:21 – Sponsor: RevSys
  • 00:18:10 – PEP 709: Inlined Comprehensions
  • 00:20:51 – 13 Tips and Techniques for Modern Flask Apps
  • 00:25:54 – Video Course Spotlight
  • 00:27:24 – Discussion: Python’s “Disappointing” Superpowers
  • 00:47:54 – replbuilder: Python helper tool for building and running a REPL with custom commands
  • 00:49:58 – pygwalker: Turn pandas Into a Tableau-Style UI
  • 00:52:15 – Thanks and goodbye

News:

Show Links: