Nick Coghlan wrote: > I'm also trying to figure out why you would ever write: > [a, b, c, d] = seq I think the ability to use square brackets is a holdover from some ancient Python version where you had to match the type of the thing being unpacked with the appropriate syntax on the lhs. It was a silly requirement from the beginning, and it became unworkable as soon as things other than lists and tuples could be unpacked. In Py3k I expect that [...] for unpacking will no longer be allowed. > Indeed. It's a (minor) pain that optional flag variables and variable length > argument lists are currently mutually exclusive. Although, if you had that > rule, I'd want to be able to write: > > def f(a, b, *, foo=1, bar=2): pass Yes, I agree. -- Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | A citizen of NewZealandCorp, a | Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. | greg.ewing at canterbury.ac.nz +--------------------------------------+
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