Python Bytes

#476: Common themes

Topics covered in this episode:

  • Migrating from mypy to ty: Lessons from FastAPI
  • Oxyde ORM
  • Typeshedded CPython docs
  • Raw+DC Database Pattern: A Retrospective
  • Extras
  • Joke
Watch on YouTube

About the show

Sponsored by us! Support our work through:

  • Our courses at Talk Python Training
  • The Complete pytest Course
  • Patreon Supporters

Connect with the hosts

  • Michael: @mkennedy@fosstodon.org / @mkennedy.codes (bsky)
  • Brian: @brianokken@fosstodon.org / @brianokken.bsky.social
  • Show: @pythonbytes@fosstodon.org / @pythonbytes.fm (bsky)

Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 11am PT. Older video versions available there too.

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 our friends of the show list, we'll never share it.

Brian #1: Migrating from mypy to ty: Lessons from FastAPI

  • Tim Hopper
  • I saw this post by Sebastián Ramírez about all of his projects switching to ty
    • FastAPI, Typer, SQLModel, Asyncer, FastAPI CLI
  • SqlModel is already ty only - mypy removed
  • This signals that ty is ready to use
  • Tim lists some steps to apply ty to your own projects
    • Add ty alongside mypy
    • Set error-on-warning = true
    • Accept the double-ignore comments
    • Pick a smaller project to cut over first
    • Drop mypy when the noise exceeds the signalAdd ty alongside mypy
  • Related anecdote:
    • I had tried out ty with pytest-check in the past with difficulty
    • Tried it again this morning, only a few areas where mypy was happy but ty reported issues
    • At least one ty warning was a potential problem for people running pre-releases of pytest,
    • Not really related: packaging.version.parse is awesome

Michael #2: Oxyde ORM

  • Oxyde ORM is a type-safe, Pydantic-centric asynchronous ORM with a high-performance Rust core.
  • Note: Oxyde is a young project under active development. The API may evolve between minor versions.
  • No sync wrappers or thread pools. Oxyde is async from the ground up
  • Includes oxyde-admin
  • Features
    • Django-style API - Familiar Model.objects.filter() syntax
    • Pydantic v2 models - Full validation, type hints, serialization
    • Async-first - Built for modern async Python with asyncio
    • Rust performance - SQL generation and execution in native Rust
    • Multi-database - PostgreSQL, SQLite, MySQL support
    • Transactions - transaction.atomic() context manager with savepoints
    • Migrations - Django-style makemigrations and migrate CLI

Brian #3: Typeshedded CPython docs

  • Thanks emmatyping for the suggestion
  • Documentation for Python with typeshed types
  • Source: typeshedding_cpython_docs

Michael #4: Raw+DC Database Pattern: A Retrospective

  • A new design pattern I’m seeing gain traction in the software space: Raw+DC: The ORM pattern of 2026
  • I’ve had a chance to migrate three of my most important web app.
  • Thrilled to report that yes, the web app is much faster using Raw+DC
  • Plus, this was part of the journey to move from 1.3 GB memory usage to 0.45 GB (more on this next week)

Extras

Brian:

  • Lean TDD 0.5 update
    • Significant rewrite and focus

Michael:

  • pytest-just (for just command file testing), by Michael Booth
  • Something going on with Encode
    • httpx: Anyone know what's up with HTTPX? And forked
    • starlette and uvicorn: Transfer of Uvicorn & Starlette
    • mkdocs: The Slow Collapse of MkDocs
    • django-rest-framework: Move to django commons?
  • Certificates at Talk Python Training

Joke:

  • Neue Rich