On Sun, Mar 6, 2011 at 2:54 PM, Ron Adam <rrr at ronadam.com> wrote: > > ... if the key matches sys.modules.__missing__ > > Works for me. ;-) > > We can find a better name than __missing__ later. (minor detail) __missing__ is a dict method. I was merely noting it would make more sense to override that rather than __setitem__ to avoid slowing down normal lookups in sys.modules. However, I'll still advocate the simple approach (two entries) for now. Assuming uniqueness of values in a dictionary is invalid in general, so code assuming it for sys.modules is arguably already incorrect. Definitely a point deserving of more discussion in the PEP, though. Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4