Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #17025 > unrolled thread
| Started by | Eelco Hoogendoorn <hoogendoorn.eelco@gmail.com> |
|---|---|
| First post | 2011-12-12 10:12 +0100 |
| Last post | 2011-12-12 10:12 +0100 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
Verbose and flexible args and kwargs syntax Eelco Hoogendoorn <hoogendoorn.eelco@gmail.com> - 2011-12-12 10:12 +0100
| From | Eelco Hoogendoorn <hoogendoorn.eelco@gmail.com> |
|---|---|
| Date | 2011-12-12 10:12 +0100 |
| Subject | Verbose and flexible args and kwargs syntax |
| Message-ID | <mailman.3536.1323681145.27778.python-list@python.org> |
> The above examples are seldom needed in Python because we have one > general method to repeatedly split a sequence into head and tail. > it = iter(iterable) # 'it' now represents the sequenced iterable > head = next(it) # 'it' now represents the tail after removing the head > In other words, next(it) encompasses all of your examples and many more. > Because 'it' is mutated to represent the tail, it does not need to be > rebound and therefore is not. The question in language design is never 'could we do these things before'. The answer is obvious: yes our CPUs are turing complete; we can do anything. The question is; how would we like to do them? So do you think the new head/tail unpacking features in python 3 are entirely uncalled for? I personally quite like them, but I would like them to be more general.
Back to top | Article view | comp.lang.python
csiph-web