This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author chris.jerdonek
Recipients asvetlov, chris.jerdonek, docs@python, eric.araujo, ezio.melotti, georg.brandl
Date 2012-09-04.13:35:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1346765735.9.0.940369831706.issue15831@psf.upfronthosting.co.za>
In-reply-to
Content
Thanks for responding to all of those questions, Ezio.  I will update the patch based on your responses.  (Likely most of it will remain the same.)

> Note that if possible, it's better to avoid using the [] and put the default
> values.  However, in these cases the default value seems to be a _void
> placeholder.

Yes, the defaults are "private" in those cases (and in I think pretty much all cases in the patch in which []'s rather than a default value are used to display keyword arguments).

> > I was curious what the preferred way to display the following is,
> > since I don't think any comma/bracket placement will work:
> >
> > ArgumentParser([description][, epilog][, prog][, usage][, add_help][, argument_default][, parents][, prefix_chars][, conflict_handler][, formatter_class])

> If the default values are known you could use them, otherwise this signature looks OK to me.

The comma not being inside the first bracket is what I was concerned about here (which was the issue raised in the original comment).  Using an initial * which you are okay with will address this.  (And yes, they are all keyword arguments.  In fact, the order of the arguments in the docs does not even match the order in the code.)

> > By the way, is the * really necessary in these examples?

> If the args on the right of the * are keyword-only and the one on the left aren't, then yes.

Okay.  I think what threw me is that I don't think we're consistently using the * throughout our docs to denote the beginning of keyword-only arguments.  The ArgumentParser constructor above is just one example.  So I wasn't sure if this notation was preferred or discouraged.
History
Date User Action Args
2012-09-04 13:35:36chris.jerdoneksetrecipients: + chris.jerdonek, georg.brandl, ezio.melotti, eric.araujo, asvetlov, docs@python
2012-09-04 13:35:35chris.jerdoneksetmessageid: <1346765735.9.0.940369831706.issue15831@psf.upfronthosting.co.za>
2012-09-04 13:35:35chris.jerdoneklinkissue15831 messages
2012-09-04 13:35:35chris.jerdonekcreate