Re: Classmethods are evil

2008-05-20 Thread Bruno Desthuilliers
Ivan Illarionov a écrit : On Mon, 19 May 2008 13:53:31 -0700, [EMAIL PROTECTED] wrote: On 17 mai, 11:50, Ivan Illarionov <[EMAIL PROTECTED]> wrote: (snip) How did I come to this:http://code.djangoproject.com/changeset/7098 I measured this and there was a marginal speed increase when classmet

Re: Classmethods are evil

2008-05-20 Thread Ivan Illarionov
On Mon, 19 May 2008 13:53:31 -0700, [EMAIL PROTECTED] wrote: > On 17 mai, 11:50, Ivan Illarionov <[EMAIL PROTECTED]> wrote: >> On Sat, 17 May 2008 02:33:13 -0300, Gabriel Genellina wrote: >> > En Sat, 17 May 2008 01:01:50 -0300, Ivan Illarionov >> > <[EMAIL PROTECTED]> escribió: >> >> >> After re-

Re: Classmethods are evil

2008-05-19 Thread Raymond Hettinger
On May 16, 9:01 pm, Ivan Illarionov <[EMAIL PROTECTED]> wrote: > After re-reading "Python is not Java" I finally came to conclusion that > classmethods in Python are a very Bad Thing. Sounds like a serious case of mis-learning. Class methods are the preferred way to implement alternate constructo

Re: Classmethods are evil

2008-05-19 Thread [EMAIL PROTECTED]
On 17 mai, 11:50, Ivan Illarionov <[EMAIL PROTECTED]> wrote: > On Sat, 17 May 2008 02:33:13 -0300, Gabriel Genellina wrote: > > En Sat, 17 May 2008 01:01:50 -0300, Ivan Illarionov > > <[EMAIL PROTECTED]> escribió: > > >> After re-reading "Python is not Java" I finally came to conclusion that > >> c

Re: Classmethods are evil

2008-05-19 Thread Bruno Desthuilliers
Ivan Illarionov a écrit : After re-reading "Python is not Java" I finally came to conclusion that classmethods in Python are a very Bad Thing. > I can't see any use-case of them that couldn't be re-written more clearly with methods of metaclass or plain functions. Plain functions don't give

Re: Classmethods are evil

2008-05-19 Thread Duncan Booth
Hans Nowak <[EMAIL PROTECTED]> wrote: > The way I see it, a class method is really just sugar for a function > operating on the class, living in the class namespace. As such, they > are basically redundant, and as you point out, they can always be > replaced by a function outside the class (and i

Re: Classmethods are evil

2008-05-17 Thread Hans Nowak
Ivan Illarionov wrote: After re-reading "Python is not Java" I finally came to conclusion that classmethods in Python are a very Bad Thing. I can't see any use-case of them that couldn't be re-written more clearly with methods of metaclass or plain functions. I agree with your sentiments, al

Re: Classmethods are evil

2008-05-17 Thread Ivan Illarionov
On Sat, 17 May 2008 02:33:13 -0300, Gabriel Genellina wrote: > En Sat, 17 May 2008 01:01:50 -0300, Ivan Illarionov > <[EMAIL PROTECTED]> escribió: > >> After re-reading "Python is not Java" I finally came to conclusion that >> classmethods in Python are a very Bad Thing. >> >> I can't see any use

Re: Classmethods are evil

2008-05-16 Thread Gabriel Genellina
En Sat, 17 May 2008 01:01:50 -0300, Ivan Illarionov <[EMAIL PROTECTED]> escribió: After re-reading "Python is not Java" I finally came to conclusion that classmethods in Python are a very Bad Thing. I can't see any use-case of them that couldn't be re-written more clearly with methods of meta

Re: Classmethods are evil

2008-05-16 Thread Carl Banks
On May 17, 12:01 am, Ivan Illarionov <[EMAIL PROTECTED]> wrote: > After re-reading "Python is not Java" I finally came to conclusion that > classmethods in Python are a very Bad Thing. > > I can't see any use-case of them that couldn't be re-written more clearly > with methods of metaclass or plain

Re: Classmethods are evil

2008-05-16 Thread Marc 'BlackJack' Rintsch
On Sat, 17 May 2008 04:01:50 +, Ivan Illarionov wrote: > After re-reading "Python is not Java" I finally came to conclusion that > classmethods in Python are a very Bad Thing. > > I can't see any use-case of them that couldn't be re-written more clearly > with methods of metaclass or plain

Classmethods are evil

2008-05-16 Thread Ivan Illarionov
After re-reading "Python is not Java" I finally came to conclusion that classmethods in Python are a very Bad Thing. I can't see any use-case of them that couldn't be re-written more clearly with methods of metaclass or plain functions. They have the following issues: 1. You mix instance-level