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/2015-February/138106.html below:

[Python-Dev] (no subject)

[Python-Dev] (no subject) [Python-Dev] (no subject)Greg Ewing greg.ewing at canterbury.ac.nz
Tue Feb 10 06:55:20 CET 2015
Donald Stufft wrote:
> However [*item for item in ranges] is mapped more to something like this:
> 
> result = []
> for item in iterable:
>     result.extend(*item)

Actually it would be

    result.extend(item)

But if that bothers you, you could consider the expansion
to be

result = []
for item in iterable:
    for item1 in item:
       result.append(item)

In other words, the * is shorthand for an extra level
of looping.

> and it acts differently than if you 
> just did *item outside of a list comprehension.

Not sure what you mean by that. It seems closely
analogous to the use of * in a function call to
me.

-- 
Greg
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