A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-August/016924.html below:

[Python-Dev] ++x oddnes

[Python-Dev] ++x oddnes [Python-Dev] ++x oddnesPaul Prescod paulp@ActiveState.com
Sat, 11 Aug 2001 16:52:49 -0700
"M.-A. Lemburg" wrote:
> 
>..
> 
> Why ? ++x can be put to some real use: I have a counter
> type which actually uses ++x to increment the counter.

Do you implement a matching "x++"? What's wrong with x.inc()?

> Note that the interpreter sees ++x as +(+x), that is the "+" is
> interpreted as unary + -- perfectly legal Python if you ask me.

Legal but perverse. Your users will expect +++x and x++ to be equally
valid and have their C semantics. Plus you are using a Python construct
that means one thing to mean something totally different just because it
means the totally different thing in other languages. In Python that
syntax would usually be side-effect free (and useless).
-- 
Take a recipe. Leave a recipe.  
Python Cookbook!  http://www.ActiveState.com/pythoncookbook



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4