Hello!
On Sat, Mar 04, 2006 at 04:31:26PM -0500, Phillip J. Eby wrote:
> I'm not sure that "more object-oriented" should be equated with "good" in
> this context, or indeed any context. :)
I am sure it is.
> A function is no more or less
> polymorphic than a method in any case, especially if the function is
> normally delegating to a slot or special method in any case.
Advantages of a method over a function:
-- a method is a more natural way to query or manipulate objects;
-- a direct method call is faster than two-level call (len() => .__len__());
-- unnecessary cluttering of builtin namespace; the namespace should(1)
contains only really global functions (__import__(), eval(), etc.)
What are the advantages of a function over a method? What are
disadvantages of a direct .len() instead of .__len__()?
Footnote:
(1) I am a perfectionist and I partially disagree with "practicality beats
purity"; I would really love a small uncluttered builtin namespace in
Python.
Oleg.
--
Oleg Broytmann http://phd.pp.ru/ [EMAIL PROTECTED]
Programmers don't die, they just GOSUB without RETURN.
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com