[Python-Dev] Re: copy, len and the like as 'object' methods?

Ka-Ping Yee ping@lfw.org
Wed, 22 Aug 2001 17:04:23 -0700 (PDT)


On Wed, 22 Aug 2001, Paul Prescod wrote:
> OO is merely accidental. The real goal is to be more consistent. Python
> is a language that uses methods for polymorphism so consistency pushes
> towards methods.

Hmm.  And what of, say, abs(-3)?  Should that be -3.abs()?

Would you also argue for [1, 2, 3].repr() and "abc".hash()?

Where do you draw the line?  Maybe my habits are too ingrained
at this point, but i kind of like the boundary between __methods__
and ordinary methods... it would somehow bug me to have all these
methods like abs, len, hash crowding in on my ordinary-method
namespace.


-- ?!ng