On Mon, Feb 07, 2005 at 02:53:49PM +0000, Antoon Pardon wrote:
> The fact that a function in a class performs a lot of magic if
> it is called through an instance, that isn't performed otherwise,
> makes python inconsistent here. You may like the arrangement
> (and it isn't such a big deal IMO) but that doesn't make it consistent.

I vote for accepting the fact (it goes with the "practicality beats
purity" bit, because otherwise all our methods would have to start
with an @instancemethod). This doesn't justify (IMVVHO) a new keyword,
like you (was it you?) seemed to imply (do you really mean for
instancemethod (or somesuch) and classmethod to become keywords?). I
think it's fine the way it is: there's an implicit @instancemethod,
and @staticmethod (which you'd have be the default if I read you
right) has to be explicit, when in classes. I think __new__ being an
exception to this is a (minor) wart, in fact it feels like premature
optimization (how many __new__s do you write, that you can't stick a
@staticmethod in front of them?

-- 
John Lenton ([EMAIL PROTECTED]) -- Random fortune:
Fun Facts, #14:
        In table tennis, whoever gets 21 points first wins.  That's how
        it once was in baseball -- whoever got 21 runs first won.

Attachment: signature.asc
Description: Digital signature

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to