Why return None?

Alex Martelli aleaxit at yahoo.com
Thu Aug 26 10:35:12 CEST 2004


Paul Rubin <http://phr.cx@NOSPAM.invalid> wrote:

> Peter Hansen <peter at engcorp.com> writes:
> > > instance, I can't say move(Vector([a,b,c]).normalize()), I have to do
> > >   a = Vector([a,b,c])
> > >   a.normalize()
> > >   move(a)
> > 
> > By the way, the second version is much more readable than the first,
> 
> That's a matter of opinion.  The lines are shorter but there are three
> times as many of them.  I think programmers ought to be able to make
> their own choices about this.  There are a lot of different styles
> that are equally legitimate.

But they're not equally Pythonic -- Python's philosophy is that there
should be preferably only one obvious way to do it.  It's a target, a
goal, not something that can be actually reached in 100% of the cases,
but it's an excellent idea.


Alex



More information about the Python-list mailing list