A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-August/017196.html below:

copy, len and the like as 'object' methods?

[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




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