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/2003-October/039524.html below:

[Python-Dev] Re: accumulator display syntax

[Python-Dev] Re: accumulator display syntax [Python-Dev] Re: accumulator display syntaxGuido van Rossum guido at python.org
Sat Oct 25 19:16:35 EDT 2003
> > No way.  There's nothing that guarantees that a+=b has the same
> > semantics as a+b, and in fact for lists it doesn't.
> 
> You mean because += is more permissive (accepts any sequence
> RHS while + insists the RHS be specifically a list)?  I don't see how
> this would make it bad to use += instead of + -- if we let the user
> sum up a mix of (e.g.) strings and tuples, why are we hurting him?

We specifically decided that sum() wasn't allowed for strings, because
it's a quadratic algorithm.  Other sequences are just as bad, we just
didn't expect that to be a common case.

Also see my not-so-far-fetched example of a semantic change.

--Guido van Rossum (home page: http://www.python.org/~guido/)

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