On 2/20/06, Josiah Carlson <jcarlson at uci.edu> wrote: > "Adam Olsen" <rhamph at gmail.com> wrote: > > Can you say, for the record (since nobody else seems to care), if > > d.getorset(key, func) would work in your use cases? > > It doesn't work for the multiset/accumulation case: > > dd[key] += 1 This is actually a fairly powerful argument for a subclass that redefines __getitem__ in favor of a new dict method. (Not to mention that it's much easier to pick a name for the subclass than for the method. :-) See the new thread I started. -- --Guido van Rossum (home page: http://www.python.org/~guido/)
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