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

Carl M. Johnson cmjohnson.mailinglist at gmail.com
Mon Mar 5 06:34:26 CET 2012

On Mar 2, 2012, at 11:21 PM, Serhiy Storchaka wrote:

> 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)

I think this use of brackets is really elegant. Not sure if it would work as syntax or not, but it's great at conveying intent.

More information about the Python-ideas mailing list