Guido van Rossum wrote: > I'd much rather be able to write "if key in d" and get the result I want... Somewhere else in this byzantine thread, I realised that what was really bothering me was the conditional semantics that dict ended up with (i.e., it's behaviour changed significantly if the default factory was set). If we go back to your idea of collection.defaultdict (or Alex's name collection.autodict), then the change in semantics bothers me a lot less, and I'd be all in favour of the more usual variant (where "key in d" implies "key in d.keys()". Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org
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