Skip to content

Latest commit

 

History

History
38 lines (31 loc) · 2.03 KB

File metadata and controls

38 lines (31 loc) · 2.03 KB

Singleton — where it lives outside this repo

Cited, real implementations to study (or point an agent at) when designing or reviewing shared-instance code.

Python standard library

Major ecosystems

What to notice across all of them

Nothing in production Python intercepts __new__ to enforce oneness. The stdlib and Django both reach for a cache plus an accessor — uniqueness is a property of where the object is stored, not of its class. And each one has an answer to test isolation (logging's per-name registry, Django's override_settings) — when reviewing shared-instance code, ask where the reset seam is.