Python Hygiene Pitfalls

Use when writing or reviewing Python that validates input with assert, creates or compares datetimes, opens text files, builds closures in a loop, caches a method, defaults a ContextVar, writes log calls or error messages, shares data between threads, relies on __del__ for cleanup, or writes a pytest.raises block: bugs that pass every test and fail under -O, in another timezone or locale, after the first loop iteration, or under load.

techmefr Updated

File contents

techmefr/mentis commit 8e62eef6e5

Frequently asked questions

npx get-skill add techmefr/python-hygiene-pitfalls