On 3/3/06, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > The double underscore convention is appropriate where the method is always > invoked magically in normal code and not called directly. The next() method > is > differenct because it is a mixed case, sometimes called magically and > sometimes > called directly. In the latter case, the name is highly visible and therefore > should not have double underscores. > > I suspect that those who feel differently are ones who usually avoid calling > next() directly. That's okay, but we shouldn't muck-up the naming for the > rest > of us who often do have a need to use next(). > > This is doubly important because we're now expanding the protocol to include > send() and throw(). Adding underscores around them too will only make those > methods look harder to use than they actually are. Don't underestimate the > psychological revulsion to calling code filled with piles of double > underscores.
I think it is a little odd that next is not spelled __next__, but I appreciate the reasons given here in particular. Every time I right .next(), I'm happy that it doesn't have underscores. Jeremy _______________________________________________ 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