[docs] [issue13386] Document documentation conventions for optional args

Baptiste Carvello report at bugs.python.org
Tue Nov 15 14:40:42 CET 2011

Baptiste Carvello <devel at baptiste-carvello.net> added the comment:

Le 14/11/2011 20:51, Eric Snow a écrit :
> So would it be worth the effort to identify each such place in the built-ins/stdlib and eventually change them all?  I've seen support for doing so in other tracker issues and think it's a good idea personally.

I ran a few grep searches from the root of a recent hg tip:

1) grep -n -r --include=*.py --include=*.c --exclude="topics.py" -E
'.+\(.*\[[[:space:]]*,.*\].*\)' .

This looks for variants of "function(args [, opt])". There were 231
hits, I caught no false positives.

2) grep -n -r --include=*.py --include=*.c --exclude="topics.py" -E
'.+\(.*\[.*,[[:space:]]*\].*\)' .

As this pattern is valid Python syntax, I got mostly false positives,
but also a few interesting cases such as "range([start,] stop[, step])"
or "islice(seq, [start,] stop [, step])"

I'm afraid those last examples cannot be described with valid Python syntax.


Python tracker <report at bugs.python.org>

More information about the docs mailing list