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/2004-November/049913.html below:

[Python-Dev] syntactic shortcut - unpack to variably sized list

[Python-Dev] syntactic shortcut - unpack to variably sized listArmin Rigo arigo at tunes.org
Sun Nov 14 14:17:08 CET 2004
Hello Nick,

On Sat, Nov 13, 2004 at 10:05:23PM +1000, Nick Coghlan wrote:
> At the moment, list.pop is described as equivalent to:
> 
> x = L[i]; del L[i]; return x

Then the documentation is not exact: if it were really equivalent to the above
definition, then we could already do today:

  a, b = L.pop(slice(0,2))

because starting from Python 2.3,

  L[slice(0,2)]

is equivalent to

  L[0:2]

So who's wrong: the documentation of list.pop() or its implementation?  It
would be nicely regular if we could pop slices.


Armin
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