Python's simplicity philosophy
Mon Nov 17 21:31:26 CET 2003
David Eppstein <eppstein at ics.uci.edu> writes:
> > Python sometimes seems to go out of its way to thrwart the use of
> > functional style. Look at list.sort returning None, for example.
> The issue here is not that it returns None, but that it changes its
> input. To be truly functional, it should return a new list and leave
> the original list unchanged. Returning None is just a helpful reminder
> that it's not functional. Of course, the functional version would often
> be less efficient...
Hmmm, good point. Returning None is still inconvenient of course.
More information about the Python-list