Classmethods are evil

Raymond Hettinger python at rcn.com
Mon May 19 19:11:10 EDT 2008


On May 16, 9:01 pm, Ivan Illarionov <ivan.illario... at gmail.com> 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
constructors.  For good examples, see dict.fromkeys() or any of the
various datetime constructors.

Raymond



More information about the Python-list mailing list