Guido van Rossum wrote: > On 2/22/06, Michael Chermside <mcherm at mcherm.com> wrote: >> A minor related point about on_missing(): >> >> Haven't we learned from regrets over the .next() method of iterators >> that all "magically" invoked methods should be named using the __xxx__ >> pattern? Shouldn't it be named __on_missing__() instead? > > Good point. I'll call it __missing__. I've uploaded a new patch to > python.org/sf/1433928. I always thought that __magic__ method calls are done by Python on objects it doesn't know about. The special method name ensures that it is indeed the protocol Python is talking about, not some random method (with next() being the exception). In the defaultdict case this isn't a problem, because defaultdict is calling its own method. Bye, Walter Dörwald
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