PythonHub
2.4K subscribers
2.35K photos
49.1K links
News & links about Python programming.
https://pythonhub.dev/
Download Telegram
Django: iterate through all registered URL patterns

Adam Johnson demonstrates a Python generator function that recursively traverses Django’s URLResolver structure to enumerate all registered URLPattern objects, including those in nested namespaces. He shows how this can be used for tasks like auditing registered views or writing tests to ensure all class-based views inherit from a specific base class.

https://adamj.eu/tech/2025/07/22/django-iterate-url-patterns/
metap: A Meta-Programming Layer for Python

metap is a new Python meta-programming layer that supports program augmentation, user-defined code generation, and structural introspection. It allows developers to automate coding patterns, extend Python with customizable macros, and have code inspect and enforce its own structure, improving maintainability and correctness. Unlike Python’s built-in tools, metap offers a unified, extensi...

https://sbaziotis.com/compilers/metap.html
Semi-Automated Assembly Verification in Python using pypcode Semantics

Philip Zucker introduces a Python toolkit that lets users add verification annotations directly to assembly code using macros, enabling semi-automated proof of correct assembly behavior via pypcode, which supports portable, architecture-agnostic analysis. This approach keeps formal verification practical and accessible for real-world low-level programming.

https://www.philipzucker.com/assembly_verify/
Stop Using Django's squashmigrations: There's a Better Way

Squashing Django migrations often breaks or complicates projects, especially when all environments are under your control. A clean reset by deleting old migrations, generating new ones, and faking migration history is a simpler and more reliable approach.

https://johnnymetz.com/posts/squash-django-migrations/
asyncio: a library with too many sharp corners

An explanation of some major issues with asyncio.

https://sailor.li/asyncio