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