class method vs static method
onurb at xiludom.gro
Tue Nov 21 12:00:31 CET 2006
Chris Brat wrote:
> I've done some reading up but I cant get my head around how/why class
> methods can be used as apposed to static methods.
a "static method" is actually not much more than a plain function
living in a class's namespace. classmethods, OTOH, have access to the
> Can anyone give an example of where they have used class methods?
The canonical use case is factory methods, but you'll typically find
other possible applications in frameworks.
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"
More information about the Python-list