Django: Equality Checks Get an Overhaul
Today's activity centers on a recurring bug class - objects that compare equal when they shouldn't, or hash inconsistently with their equality logic - fixed across model primary keys, query lookups, and a media asset class.
Duration: PT2M35S
Episode overview
This episode is a short developer briefing from Django.
It explains recent repository work in plain language.
- Show: Django
- Published: 2026-09-02T13:05:54Z
- Audio duration: PT2M35S
Transcript excerpt
This excerpt keeps the crawler page concise. Listen to the episode or use the RSS feed for the full update.
You're listening to Django, your daily developer briefing for September 2nd, 2026.
The clear throughline today is equality logic done wrong, and the ripple effects of fixing it properly.
Start with primary keys. PR 21861, from Denny Biasiolli, fixes ticket 37309: Model dunder-eq was still checking if the primary key is none to decide whether an instance was unsaved. That check breaks for composite primary keys, where an unsaved key looks like a tuple of nones, and for database-default keys, which…
Second theme: query correctness under the hood. PR 21864 from Yassin Bahri fixes a regression where right-hand-side iterators in "in" and range lookups got consumed prematurely when the left-hand side was an annotation - the fix materializes the iterator once before inspecting it. The same author opened PR 21867,…
Third: MediaAsset equality, still in progress. Miladkhoshdel opened three linked PRs - 21866, 21868, and 21869 - all targeting ticket 37310, where MediaAsset instances with attributes were incorrectly comparing equal to plain string paths. The overlapping PRs suggest iteration toward a single correct fix rather than…
What to remember: when you touch equality, touch hashing too,…
Nearby episodes from Django
- Correctness Fixes Cluster Around Regressions
- Widening the Browser Test Net
- Weekly Recap - Data Integrity, Query Correctness, and Duplicate Submissions
- Query Correctness Takes Center Stage
- Sharper Test Feedback, One Bug at a Time
- Hardening Against Silent Failures
- Duplicate Fixes Converge on Database Routing and HTTP Precondition Bugs
- Two Regressions, Two Fixes