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/2002-November/030370.html below:

* (and **?) in assignments

[Python-Dev] Half-baked proposal: * (and **?) in assignmentsRaymond Hettinger python@rcn.com
Sat, 23 Nov 2002 12:57:50 -0500
>     a,b,*c = 1,2,3,4,5

Hmm, a right-associative unary tuplizer that
is only valid for the right mostvariable in
the left-hand-side of a multiple-assignment.
It sure doesn't sound like a simplication.

Still, it looks like a handy tool for ML style 
head/tail separation:

head, *tail = func_returning_a_sequence()

And, it beats the existing alternative:

seq = func_returning_a_sequence()
head, tail = seq[0], seq[1:]


>     a,b,c,d,e = 1,2,*(3,4,5)

In this, the exisiting alternative is better:

a,b,(c,d,e) = 1,2,(3,4,5)



Raymond Hettinger




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