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/2013-February/123889.html below:

[Python-Dev] why do we allow this syntax?

[Python-Dev] why do we allow this syntax? [Python-Dev] why do we allow this syntax?Xavier Morel catch-all at masklinn.net
Fri Feb 8 16:50:42 CET 2013
On 2013-02-08, at 16:39 , Chris Withers wrote:

> Hi All,
> 
> Just had a bit of an embarrassing incident in some code where I did:
> 
> sometotal =+ somevalue
> 
> I'm curious why this syntax is allowed? I'm sure there are good reasons, but thought I'd ask…

sometotal = (expression) is valid syntax, and +value is valid syntax.

Thus what you wrote is perfectly normal syntax, it's the assignment of a
pos'd value, badly formatted. pep8.py will warn against it (it'll
complain that the whitespace around `+` is wonky). But I see no
justification for disallowing this, anymore than for disallowing the
rougly equivalent (and just as error-prone) `sometotal = -somevalue`.
More information about the Python-Dev mailing list

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