Python Best Practice Patterns
Several of those patterns are incomplete or frowned upon:<p>* if a method does not use the object's state (no `self` usage) make it a `class-` or `staticmethod`.<p>* Some magic methods are presented. There's more to them[0].<p>* one should not write `class MyClass:` but `class MyClass(object):` (new style class[1])<p>* the last one (`return None`) make me very dubious<p>* Cascading methods: that's a big <i>no</i>. The idiom is that if a method may change the state of the object then it should return None (eg `set.add`)<p>0: well-written and comprehensive guide: <a href="http://www.rafekettler.com/magicmethods.html" rel="nofollow">http://www.rafekettler.com/magicmethods.html</a><p>1: <a href="http://www.python.org/doc/newstyle/" rel="nofollow">http://www.python.org/doc/newstyle/</a>