Guido van Rossum wrote: > On 2/22/06, Michael Chermside <[EMAIL PROTECTED]> 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 _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com