[Python-ideas] keyword arguments everywhere (stdlib) - issue8706

Cameron Simpson cs at zip.com.au
Sat Mar 3 23:17:22 CET 2012


On 02Mar2012 14:01, Gregory P. Smith <greg at krypto.org> wrote:
| On Fri, Mar 2, 2012 at 12:00 PM, Guido van Rossum <guido at python.org> wrote:
| > I've written such decorators too, but they've got quite a bit of
| > overhead...
| >
| yeah those fall into the gross hacks I alluded to in my original post. ;)
| 
| I intentionally decided to leave out discussion of "should we allow
| positional-only arguments to be declared in Python" but it is a valid
| discussion and thing to consider...
| 
| if we go that route, could it be possible to implement range([start=0, ]
| stop[, step=1]) such that they are positional only but mutliple arguments
| are treated different than strictly sequential without writing conditional
| code in Python to figure out each one's meaning at runtime.

More excitiingly, one could embed a slice in the hypothetical
positional-only syntax to say the 0th, 2nd and 4th parameters are
positional-only. Or an arbitrary sequence!

Hmm, a callable that returns an iterable at function call time!

Sorry, too much coffee...
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

Give me the luxuries of life and I will willingly do without the necessities.
- Frank Lloyd Wright



More information about the Python-ideas mailing list