Python Bytes is a weekly podcast hosted by Michael Kennedy and Brian Okken. The show is a short discussion on the headlines and noteworthy news in the Python, developer, and data science space.

#420 90% Done in 50% of the Available Time

February 17, 2025 00:27:47 5.09 MB ( 21.58 MB less) Downloads: 0
Topics covered in this episode:
Watch on YouTube

About the show

Sponsored by us! Support our work through:

Connect with the hosts

Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 10am 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: PEP 772 – Packaging governance process

  • draft, created 21-Jan, by Barry Warsaw, Deb Nicholson, Pradyun Gedam
  • “As Python packaging has matured, several interrelated problems with the current way of managing the technical development, decision making and processes have become apparent.”
  • “This PEP proposes a Python Packaging Council with broad authority over packaging standards, tools, and implementations. Like the Python Steering Council, the Packaging Council seeks to exercise this authority as rarely as possible; instead, they use this power to establish standard processes.”
  • PEP discusses
    • PyPA, Packaging-WG, Interoperability Standards, Python Steering Council, and Expectations of an elected Packaging Council
    • A specification with
      • Composition: 5 people
      • Mandate, Responsibilities, Delegations, Process, Terms, etc.

Michael #2: Official Django MongoDB Backend Now Available in Public Preview

  • Over the last few years, Django developers have increasingly used MongoDB, presenting an opportunity for an official MongoDB-built Python package to make integrating both technologies as painless as possible.
  • Features
    • The ability to use Django models with confidence. Developers can use Django models to represent MongoDB documents, with support for Django forms, validations, and authentication.
    • Django admin support. The package allows users to fire up the Django admin page as they normally would, with full support for migrations and database schema history.
    • Native connecting from settings.py. Just as with any other database provider, developers can customize the database engine in settings.py to get MongoDB up and running.
    • MongoDB-specific querying optimizations. Field lookups have been replaced with aggregation calls (aggregation stages and aggregate operators), JOIN operations are represented through $lookup, and it’s possible to build indexes right from Python.
    • Limited advanced functionality. While still in development, the package already has support for time series, projections, and XOR operations.
    • Aggregation pipeline support. Raw querying allows aggregation pipeline operators. Since aggregation is a superset of what traditional MongoDB Query API methods provide, it gives developers more functionality.

Brian #3: Developer Philosophy

  • by qntm
  • Intended as “advice for junior developers about personal dev philosophy”, I think these are just great tips to keep in mind.
  • The items
    • Avoid, at all costs, arriving at a scenario where the ground-up rewrite starts to look attractive
      • This is less about “don’t do rewrites”, but about noticing the warning signs ahead of time.
    • Aim to be 90% done in 50% of the available time
      • Great quote: “The first 90% of the job takes 90% of the time. The last 10% of the job takes the other 90% of the time.”
    • Automate good practices
    • Think about pathological data
      • “Nobody cares about the golden path. Edge cases are our entire job.”
      • Brian’s note: But also think about the happy path. Documenting and testing what you think of as the happy path is a testing start and helps others understand your idea of how things are supposed to work.
    • There’s usually a simpler way to write it
    • Write code to be testable
    • It is insufficient for code to be provably correct; it should be obviously, visibly, trivially correct
      • Brian’s note: Even if it’s obviously, visibly, trivially correct, it will still break. So test it anyway.

Michael #4: Python 3.13.2 released

  • Python 3.13’s second maintenance release.
  • About 250 changes went into this update
  • Also Python 3.12.9, Python 3.12’s ninth maintenance release already. Just 180 changes for 3.12, but it’s still worth upgrading.
  • For us, it’s simply rebuilding our Docker base (i.e. —no-cache) with these lines:
    RUN curl -LsSf https://astral.sh/uv/install.sh | sh
    RUN --mount=type=cache,target=/root/.cache uv venv --python 3.13 /venv
    

Extras

Brian:

  • Still thinking about pytest plugins a lot.
  • The top pytest plugin list
    • Has been updated for Feb
    • Is starting to include things without “pytest” in the name, like Hypothesis and Syrupy.
      • Eventually I’ll have to add “looking at trove classifiers” as part of the search, but for now, let me know if you’re favorite is missing.
    • Includes T&C podcast episode links if I’ve covered it on the show.
      • There’s 2 so far

Michael:

Joke: