[Python-ideas] Mitigating 'self.' Method Pollution
Stephen J. Turnbull
stephen at xemacs.org
Mon Jul 13 05:05:11 CEST 2015
John Wong writes:
> I disagree that we really need to distinguish what consituttes
> enterprisey code. In fact it is a bad idea to think there is even
> such notion because people should express code in the cleanest and
> most intuitive way possible.
I don't think "unintuitive" is what is meant by "enterprisey code". I
suspect that what is meant is large objects that have slews of
attributes that need to be initialized, with a large variety of
conventions for constructing defaults. If your code needs to consist
mostly of long sequences of attribute assignments followed by
returning the result of a method call, I see nothing wrong with
writing it as a long sequence of assignments followed by a method
call.
More information about the Python-ideas
mailing list