> Saying the same thing in another way, I see 'len' as a built-in > *operation*. I'd hate to lose that. I can't say for sure whether you > meant that or not, but 'def len(self): ...' certainly sounds like you > want to demote it to an ordinary method. I'm strongly -1 on that.
OK, I can see that. So the built-in function len() and its cousins should be thought of as special Python syntax. I see no real reason to remove that; if "<" just invokes a standard method "orderable.lessthan", the built-in len can just invoke "container.len". But foo.len() would also be available for use. > I didn't want these special operations to use ordinary > method names, because then pre-existing classes, or classes written by > users without an encyclopedic memory for all the special methods, > would be liable to accidentally define operations they didn't mean to > implement, with possibly disastrous consequences. Hmmm. This seems kind of a weak rationale to me, but OK. Bill _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com