The guidebook / 181 guides
Developer tools
Code, configuration and workflows. Source-linked checks to help you move forward.
Python Heapq Cannot Compare Dictionaries at Equal Priority: Add a Unique Tie Breaker
A heap accepts the first task but raises TypeError when another dictionary has the same priority.
Python Itertools.tee Memory Grows: Account for Consumer Lag
Two iterator branches consume one source at different speeds, retaining earlier values for the slower branch.
Python SQLite IN With a List: Generate Placeholders and Bind Each Value
Binding a Python list to one question mark does not expand it into an SQL IN list.
Python CSV Field Larger Than Field Limit: Raise a Measured Bound and Restore It
A CSV parser rejects one very long field even though the file opens normally.
Python Queue.empty Is Not a Reservation: Catch Empty at the Get Operation
A consumer checks that a queue has data and then blocks anyway. Make the retrieval decision atomically through the queue API.
Python ThreadPoolExecutor Appears to Ignore Exceptions: Read Every Future Result
A submitted task fails without a traceback in the caller. Collect outcomes explicitly rather than treating submit as success.
Python List Removal Skips Items: Filter First and Choose Whether to Preserve Identity
Adjacent matching items survive a cleanup loop because removal shifts the remaining indexes.
Python Dictionary Changed Size During Iteration: Choose a Snapshot or Rebuild
A dictionary cleanup raises RuntimeError after removing a key. Separate the traversal from structural changes.
Python Urljoin Drops a Path Segment: Check Reference Resolution and Origin
Joining a relative URL removes the last base segment or changes the hostname.
Python CSV Turns None Into Empty Text: Define a Reversible Null Contract
A CSV round trip cannot distinguish a missing value from an empty string.
Itertools Groupby Splits the Same Key: Sort or Accumulate Deliberately
Equal keys appear in several groups, or stored group iterators are empty later.
Dataclass Default Factory Is Not Callable: Pass a Constructor or Function
A dataclass field fails because default_factory was given a list value.
Python Cached Method Keeps an Instance Alive: Inspect Cache Ownership
Deleting an object does not release it after an lru_cache-decorated method was called.
Pathlib Join Drops the Base Directory: Check Absolute and Rooted Components
Joining a child path unexpectedly produces a path outside the chosen base.
Shutil Move Creates an Extra Directory Level: Inspect the Destination First
Moving a directory nests it inside an existing destination instead of renaming it.
Python Subprocess Loses Environment Settings: Decide Whether to Merge Env
Passing a small env dictionary causes a child process to lose inherited settings.
Asyncio Gather Raises but Other Tasks Continue: Own the Remaining Tasks
One gather task fails while sibling tasks keep running or appear to stop at program exit.
Asyncio Run Cannot Start Inside a Running Loop: Await at the Existing Boundary
A notebook or async callback raises an error when it calls asyncio.run.