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

Serhiy Storchaka storchaka at gmail.com
Sat Mar 3 10:21:22 CET 2012

03.03.12 00:18, Guido van Rossum написав(ла):
> On Fri, Mar 2, 2012 at 2:01 PM, Gregory P. Smith<greg at krypto.org>  wrote:
> Eew, I don't think this pattern is useful enough to support in syntax,
> even if one of the most popular builtins (but only one!) uses it.

range([start,] stop[, step])
slice([start,] stop[, step])
itertools.islice(iterable, [start,] stop [, step])
random.randrange([start,] stop[, step])
syslog.syslog([priority,] message)
curses.newwin([nlines, ncols,] begin_y, begin_x)
curses.window.addch([y, x,] ch[, attr])
curses.window.addnstr([y, x,] str, n[, attr])
curses.window.addstr([y, x,] str[, attr])
curses.window.chgat([y, x, ] [num,] attr)
curses.window.derwin([nlines, ncols,] begin_y, begin_x)
curses.window.hline([y, x,] ch, n)
curses.window.insch([y, x,] ch[, attr])
curses.window.insnstr([y, x,] str, n [, attr])
curses.window.subpad([nlines, ncols,] begin_y, begin_x)
curses.window.subwin([nlines, ncols,] begin_y, begin_x)
curses.window.vline([y, x,] ch, n)

>> speaking of range... I think start and stop are plenty obvious, but I'd like
>> to allow step to be specified as a keyword.
> That's fine, range() is not overloadable anyway.

There are number of range-like functions in third-party modules.

More information about the Python-ideas mailing list