[Tutor] decomposing a problem
Steven D'Aprano
steve at pearwood.info
Tue Dec 25 20:29:59 EST 2018
On Wed, Dec 26, 2018 at 01:06:04AM +0000, Alan Gauld via Tutor wrote:
> In Smalltalk the default return value from
> any method is self. In Python it is None.
>
> self allows chaining of methods, None does not.
You might be interested in this simple recipe for retrofitting method
chaining onto any class:
http://code.activestate.com/recipes/578770-method-chaining-or-cascading/
--
Steve
More information about the Tutor
mailing list