News for hackers. Stuff that matters.
Re:Python Best Practice Patterns by nine_k on Friday February 28, 2014 @03:26PM (#7321230)
Cascading methods aka fluid interface are OK in many cases, e.g. various builders. OTOH immutable objects are preferable in many cases.

What I really disliked is storing intermediate results of a multi-stage computation in instance variables. It is so easy to return multiple values from Python functions. Also, thinking what you need and need not pass and return between interconnected functions helps structure them much better, into smaller, clearer pieces (as #1 correctly advises).

There are no comments on this comment yet.