incrementation operators?

Alex Martelli alex at magenta.com
Sun Aug 13 11:42:18 EDT 2000


"Colin J. Williams" <cjw at connection.com> wrote in message
news:3996B14F.5BE77F8D at connection.com...
> Thomas,
>
> Apologies for entering this so late in the game.
>
> The PEP gives a full description of the various operators, but provides no
rationale
> for their introduction.
>
> I wonder how frequently this sort of operation in place would be used in
practice.

In languages which have had such operators for a long time, such as C and
Icon, they are used with very high frequency.  It therefore seems to me that
the onus of proof should be on those who claim they use would not be as
frequent in Python, to show where the difference would come.  Note that
'higher semantic level' does not apply -- Icon, who's happily had +:= and
friends for a long time, IS a higher-semantic-level language too.

> Does the frequency of likely use balance the increased clutter?  One of
the
> attractive features of Python is its relative simplicity.  Would we lose
some of
> this simplicity for little practical gain?

The key gain is in saying something only once; expressing an idea, which
one thinks of as "add this to that", in exactly these terms, rather than the
roundabout idiom "bind this to this plus that".  Directness of expression
is not a "little practical gain", it's a substantial gain of clarity.

> These operators exist in other languages.  Is there a justification for
including
> them in Python?

Directness and clarity seem important justifications to me.


Alex






More information about the Python-list mailing list