Python Opinions and Zeitgeist with Hynek
Episode #481,
published Thu, Oct 17, 2024, recorded Tue, Oct 8, 2024
Hynek has been writing and speaking on some of the most significant topics in the Python space and I've enjoyed his takes. So I invited him on the show to share them with all of us. This episode really epitomizes one of the reasons I launched Talk Python 9 years ago. It's as if we run into each other at a bar during a conference and I ask Hynek, "So what are your thoughts on ..." and we dive down the rabbit hole for an hour. I hope you enjoy it.
Episode Deep Dive
1. Hynek’s Background and Context
- Role and Company
- Works at a small web-hosting / domain registrar in Germany, hosting everything on-prem (no public cloud).
- Emphasizes stability and reliability over chasing “hyperscaler” patterns (no Kubernetes, simpler solutions with HashiCorp Nomad, etc.).
- Open Source Maintainer
- Maintains various projects (e.g. attrs, Argon2, Stamina).
- Previously contributed to Python’s packaging landscape (and was heavily involved in early data classes design).
2. Docker + Virtual Environments
- Still Using
venv
Inside Docker - It keeps environment isolation consistent in local dev and in production.
- Some people rely on
pip install --user
or no venv in Docker images, but Hynek findsvenv
more predictable. - Docker Build Performance
- Multi-stage builds: build your Python dependencies in a separate container, then copy only the final environment into the runtime container, reducing size and security risk.
- Build cache mounts: rely on Docker’s buildkit features (
--mount
) to cache dependencies; speeds up repeated builds. - Layer ordering: place steps least likely to change (e.g. installing dependencies) before copying your app code.
3. Python 3.13 and Beyond
- Free-Threaded Python
- Formerly known as removing the GIL: a separate build option that removes the global interpreter lock.
- Likely helpful for multi-core concurrency, but single-thread performance can be ~10% slower.
- Some C-extensions (CFFI, for example) must adapt. Real-world impact still evolving.
- Foundational Changes
- 3.12 and 3.13 each have a lot of “infrastructure” changes that will bear fruit in the future, especially sub-interpreters, better tooling for multi-core usage, and performance improvements.
4. Hynek’s YouTube Channel
- Motivation
- Misses the bigger Python conference scene (travel cutbacks, fewer invites).
- Blogging traffic is way down due to changes in Google/Twitter.
- Sees YouTube as the second largest search engine and a direct way to share opinions / tutorials.
- Style and Goals
- Produces well-edited videos on packaging, Docker, Python build tips, etc.
- Aims at more advanced or mid-level Python devs who want production best practices.
5. Projects to Know
- Attrs
- Precursor to data classes (still more feature-rich).
- “Class writing toolkit” for Python, offering advanced features like custom comparisons, optional type annotations, slotted classes, etc.
- Argon2
- Modern memory-hard password hashing library.
- Argon2 won the password-hashing competition; Hynek maintains the Python bindings.
- Stamina
- A simpler, typed “retry” decorator built on top of
tenacity
but with safe defaults (exponential backoff, jitter, clean typing).
6. Opinions on Typing and AI/LLMs
- Type Hints
- Hynek sees them as a valuable aid for discovering design mistakes, especially optional fields vs. non-optionals.
- Encourages smaller, more predictable APIs.
- Python’s “gradual” typing approach = the sweet spot (start messy, refine over time).
- LLMs (Large Language Models)
- Hynek uses them for quick code scaffolding (e.g. generating SQL queries or regular expressions).
- Concern: they can produce insecure “trash code” if devs can’t verify correctness.
- Concern for juniors: harder to learn fundamentals if the LLM is generating boilerplate.
- Overall: a powerful tool if used by experienced devs, but may distort how new devs come up in Python.
Overall Takeaway
Hynek’s experience maintaining libraries and running a small on-prem hosting company gives him a distinct “no-Google-cosplay” perspective. He advocates simpler and more consistent approaches to Docker, packaging, and Python deployment. Tools like venv
+ Docker are still relevant, even as Rust-based packaging tools (e.g. “uv” from Astral) gain traction. With Python 3.13 continuing the “secret 4.0” metamorphosis, the future of concurrency (free-threaded Python) and packaging in Python is exciting—but it’s an evolution best navigated with clear-eyed pragmatism.
Links from the show
Hynek Schlawack on Mastodon: @hynek
Why I Still Use Python Virtual Environments in Docker: hynek.me
Production-ready Python Docker Containers with uv: hynek.me
Attrs: github.com
uv: astral.sh
What’s New In Python 4: python.org
BusyBox: busybox.net
Hynek's YouTube Channel: youtube.com
MOPUp for macOS: github.com
Homebrew Python Is Not For You: justinmayer.com
argon2-cffi: Argon2 for Python: github.com
pytest-freethreaded: github.com
LM Studio: lmstudio.ai
StackOverflow Trends Graph: trends.stackoverflow.co
Watch this episode on YouTube: youtube.com
Episode transcripts: talkpython.fm
--- Stay in touch with us ---
Subscribe to Talk Python on YouTube: youtube.com
Talk Python on Bluesky: @talkpython.fm at bsky.app
Talk Python on Mastodon: talkpython
Michael on Bluesky: @mkennedy.codes at bsky.app
Michael on Mastodon: mkennedy
Why I Still Use Python Virtual Environments in Docker: hynek.me
Production-ready Python Docker Containers with uv: hynek.me
Attrs: github.com
uv: astral.sh
What’s New In Python 4: python.org
BusyBox: busybox.net
Hynek's YouTube Channel: youtube.com
MOPUp for macOS: github.com
Homebrew Python Is Not For You: justinmayer.com
argon2-cffi: Argon2 for Python: github.com
pytest-freethreaded: github.com
LM Studio: lmstudio.ai
StackOverflow Trends Graph: trends.stackoverflow.co
Watch this episode on YouTube: youtube.com
Episode transcripts: talkpython.fm
--- Stay in touch with us ---
Subscribe to Talk Python on YouTube: youtube.com
Talk Python on Bluesky: @talkpython.fm at bsky.app
Talk Python on Mastodon: talkpython
Michael on Bluesky: @mkennedy.codes at bsky.app
Michael on Mastodon: mkennedy