Hussein B a écrit :
Hi,
I'm familiar with static method concept,

Which is more often than not useless in Python - we have true functions and modules.

but what is the class method?

Short answer : It's a method that can be looked up upon both the class or an instance of it, and takes the class itself (instead of the instance) as first parameter.

how it does differ from static method?

static methods don't receive the class object as first param.

when to use it?

When you need to access the class (using polymorphic dispatch), don't care about the instance itself, and want to be able to call the method on both the class or an instance.

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

Reply via email to