Why return None?

Antoon Pardon apardon at forel.vub.ac.be
Fri Aug 27 07:33:23 EDT 2004


Op 2004-08-27, Alex Martelli schreef <aleaxit at yahoo.com>:
> Antoon Pardon <apardon at forel.vub.ac.be> wrote:
>    ...
>> Fine practicality beats purity, but then the proponents shouldn't
>> put that much weight on consistency, because practicality breaks
>> consistency.
>
> No: "but special cases aren't special enough to break the rules".  No
> rule was broken by introducing += and friends.
>
>
>> In this case I think the practicality of method chaining beats
>> the purity of not allowing side-effects in print statements and
>> of having only one obvious way to do things.
>
> You think one way, GvR thinks another, and in Python GvR wins.  Go
> design your own language where what you think matters.

Why the fuss over the chosen decorator syntax if  GvR
wins anyhow.  Why don't you go tell all those people
arguing decorator syntax that they should design their own
language where what they think matters.

If you think I shouldn't voice an opinion here because GvR
wins anyhow and my opinion won't matter fine. Just say so
from the beginning. Don't start with pretending that you
have good arguments that support the status quo because
all that matters is that GvR prefers it this way.
All good arguments in support are just a coincidence in
that case.

>> I don't see that much difference in the frustration of having
>> to write: 
>> 
>>   t = f(x)
>>   v[t] = v[t] + 1
>
> You're repeating (necessarily) the indexing operation, which may be
> unboundedly costly for a user-coded type.

That repetion is just pythons inabilty to optimise.

>> and the frustration of having to write
>> 
>>   lst = f(x)
>>   lst.sort()
>>   lst.reverse()
>
> Here, no operation is needlessly getting repeated.

Yes there is, the operation to find lst from the local dictionary.
Although it wont be unboundedly costly.

> If you don't see much difference between forcing people to code in a way
> that repeats potentially-costly operations,
> and forcing a style that
> doesn't imply such repetitions, I wonder how your language will look.

I'm sure that if I ever find the time to do so, you won't like it.

> Still, I'm much happier thinking of you busy designing your own
> wonderful language, than wasting your time and yours here, busy
> criticizing what you cannot change.

If you don't want to waste time, just state from the beginning
that this is how GvR wanted it and people won't be able to
change it.

You shouldn't start by arguing why the language as it is is as
it should because that will just prolong the discussion as
people will give counter arguments for what they think would
be better. If you know that, should people not be persuaded
by your arguments, you will resort to GvR autority and declare
the arguments a waste of time, you are better of puttings
GvR autority that can't be questioned on the table as soon
as possible.

-- 
Antoon Pardon



More information about the Python-list mailing list