Topics include Advent of Code, Django 6 is coming, Advanced, Overlooked Python Typing, and codespell.

Python Bytes

Michael Kennedy and Brian Okken

#460 Overlooked Python Typing

DEC 1, 202524 MIN
Python Bytes

#460 Overlooked Python Typing

DEC 1, 202524 MIN

Description

<strong>Topics covered in this episode:</strong><br> <ul> <li><strong><a href="https://adventofcode.com?featured_on=pythonbytes">Advent of Code</a> starts today</strong></li> <li><strong><a href="https://docs.djangoproject.com/en/dev/releases/6.0/?featured_on=pythonbytes">Django 6 is coming</a></strong></li> <li><strong><a href="https://martynassubonis.substack.com/p/advanced-overlooked-python-typing?featured_on=pythonbytes">Advanced, Overlooked Python Typing</a></strong></li> <li><strong><a href="https://github.com/codespell-project/codespell?featured_on=pythonbytes">codespell</a></strong></li> <li><strong>Extras</strong></li> <li><strong>Joke</strong></li> </ul><a href='https://www.youtube.com/watch?v=V_eHMgxxhLY' style='font-weight: bold;'data-umami-event="Livestream-Past" data-umami-event-episode="460">Watch on YouTube</a><br> <p><strong>About the show</strong></p> <p>Sponsored by us! Support our work through:</p> <ul> <li>Our <a href="https://training.talkpython.fm/?featured_on=pythonbytes"><strong>courses at Talk Python Training</strong></a></li> <li><a href="https://courses.pythontest.com/p/the-complete-pytest-course?featured_on=pythonbytes"><strong>The Complete pytest Course</strong></a></li> <li><a href="https://www.patreon.com/pythonbytes"><strong>Patreon Supporters</strong></a></li> </ul> <p><strong>Connect with the hosts</strong></p> <ul> <li>Michael: <a href="https://fosstodon.org/@mkennedy">@[email protected]</a> / <a href="https://bsky.app/profile/mkennedy.codes?featured_on=pythonbytes">@mkennedy.codes</a> (bsky)</li> <li>Brian: <a href="https://fosstodon.org/@brianokken">@[email protected]</a> / <a href="https://bsky.app/profile/brianokken.bsky.social?featured_on=pythonbytes">@brianokken.bsky.social</a></li> <li>Show: <a href="https://fosstodon.org/@pythonbytes">@[email protected]</a> / <a href="https://bsky.app/profile/pythonbytes.fm">@pythonbytes.fm</a> (bsky)</li> </ul> <p>Join us on YouTube at <a href="https://pythonbytes.fm/stream/live"><strong>pythonbytes.fm/live</strong></a> to be part of the audience. Usually <strong>Monday</strong> at 10am PT. Older video versions available there too.</p> <p>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 <a href="https://pythonbytes.fm/friends-of-the-show">our friends of the show list</a>, we'll never share it.</p> <p><strong>Brian #1: <a href="https://adventofcode.com?featured_on=pythonbytes">Advent of Code</a> starts today</strong></p> <ul> <li>A few changes, like 12 days this year, which honestly, I’m grateful for.</li> <li>See also: <a href="https://github.com/cak/elf?featured_on=pythonbytes">elf: Advent of Code CLI helper for Python</a></li> </ul> <p><strong>Michael #2: <a href="https://docs.djangoproject.com/en/dev/releases/6.0/?featured_on=pythonbytes">Django 6 is coming</a></strong></p> <ul> <li><em>Expected December 2025</em></li> <li>Django 6.0 supports Python 3.12, 3.13, and 3.14</li> <li>Built-in support for the <a href="https://docs.djangoproject.com/en/6.0/topics/security/#security-csp">Content Security Policy (CSP)</a> standard is now available, making it easier to protect web applications against content injection attacks such as cross-site scripting (XSS).</li> <li>The <a href="https://docs.djangoproject.com/en/6.0/topics/templates/#template-language-intro">Django Template Language</a> now supports <a href="https://docs.djangoproject.com/en/6.0/ref/templates/language/#template-partials">template partials</a>, making it easier to encapsulate and reuse small named fragments within a template file.</li> <li>Django now includes a built-in Tasks framework for running code outside the HTTP request–response cycle. This enables offloading work, such as sending emails or processing data, to background workers.</li> <li>Email handling in Django now uses Python’s modern email API, introduced in Python 3.6. This API, centered around the <a href="https://docs.python.org/3/library/email.message.html#email.message.EmailMessage"><strong>&lt;code>email.message.EmailMessage&lt;/code></strong></a> class</li> </ul> <p><strong>Brian #3: <a href="https://martynassubonis.substack.com/p/advanced-overlooked-python-typing?featured_on=pythonbytes">Advanced, Overlooked Python Typing</a></strong></p> <ul> <li>get_args, TypeGuard, TypeIs, and more goodies</li> </ul> <p><strong>Michael #4: <a href="https://github.com/codespell-project/codespell?featured_on=pythonbytes">codespell</a></strong></p> <ul> <li>Learned from <a href="https://github.com/mikeckennedy/talk-python-in-production-devops-book/pull/14?featured_on=pythonbytes">this PR for the Talk Python book</a>.</li> <li>Fix common misspellings in text files.</li> <li>It's designed primarily for checking misspelled words in source code (backslash escapes are skipped), but it can be used with other files as well.</li> <li>It does not check for word membership in a complete dictionary, but instead looks for a set of common misspellings. Therefore it should catch errors like "adn", but it will not catch "adnasdfasdf".</li> <li>It shouldn't generate false-positives when you use a niche term it doesn't know about.</li> </ul> <p><strong>Extras</strong></p> <p>Brian:</p> <ul> <li><a href="https://github.com/mkdocs/mkdocs/discussions/4010?featured_on=pythonbytes">Is mkdocs maintained?</a></li> <li><a href="https://hatch.pypa.io/latest/blog/2025/11/24/hatch-v1160/?featured_on=pythonbytes">Hatch 1.16</a></li> </ul> <p>Michael:</p> <ul> <li>Follow up on tach from Gerben Dekker: <ul> <li><strong><code>tach</code> has been unmaintained for a bit but is not anymore</strong>. It was the main product from Gauge which is a Y combinator startup that pivoted to something unrelated and abandoned <code>tach</code>. However, https://github.com/DetachHead forked it but now got access to the main repo and has committed to maintaining it.</li> <li><code>ruff analyze graph</code> is fully independent of <code>tach</code> - we actually started to look into alternatives for <code>tach</code> when it became unmaintained and then found <code>ruff analyze graph</code>.</li> <li>For our use case, with just a bit of manipulation on top of <code>ruff analyze graph</code> we replaced our use of <code>deptry</code> (which was slower - and I try to be careful depending on one-man projects).</li> </ul></li> <li><a href="https://happycanvasandcode.com/posts/my_review/?featured_on=pythonbytes">A Review of Michael Kennedy’s book, “Talk Python in Production”</a> - Thanks Doug</li> </ul> <p><strong>Joke: <a href="https://github.com/hotheadhacker/no-as-a-service?featured_on=pythonbytes">NoaaS</a></strong></p>