A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2009-January/085207.html below:

[Python-Dev] Questions/comments on documentation formatting

[Python-Dev] Questions/comments on documentation formattingScott Dial scott+python-dev at scottdial.com
Tue Jan 20 04:02:04 CET 2009
Brett Cannon wrote:
> 3. Are brackets for optional arguments (e.g. ``def fxn(a [, b=None [,
> c=None]])``) really necessary when default argument values are
> present? And do we really need to nest the brackets when it is obvious
> that having on optional argument means the rest are optional as well?

I can't think of an example off the top of my head, but I'm certain the
point of nesting the brackets is to delimit the optional arguments into
groups. Documenting your fxn() examples as "fxn(a [, b=None, c=None])"
would imply that if you provide 'b' then you must provide 'c', or if we
abandon nested brackets, it's ambiguous as to the requirements. Imagine
seeing "foo(a [, b=None, c=None [, d=None]])" and I think the rationale
for such notation becomes clear.

-- 
Scott Dial
scott at scottdial.com
scodial at cs.indiana.edu
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4