Message169726
| Author |
chris.jerdonek |
| Recipients |
asvetlov, chris.jerdonek, docs@python, eric.araujo, ezio.melotti, georg.brandl |
| Date |
2012年09月02日.22:33:51 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1346625234.47.0.909901441507.issue15831@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Attaching a proposed patch for the default branch. Also, here are several comments and questions.
> I think/hope that all the APIs we have in the stdlib are sane enough to have no more than 2-3 signatures
I found this one in the curses module with four:
window.chgat(attr)
window.chgat(num, attr)
window.chgat(y, x, attr)
window.chgat(y, x, num, attr)
Do we like how these look? Is the bare star notation too obscure?
inspect.Signature.replace(*[, parameters][, return_annotation])
inspect.Parameter.replace(*[, name][, kind][, default][, annotation])
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])
(unless perhaps we use the construction "ArgumentParser(*[, description][, epilog]....")
I'm not sure how we want to handle this one using multiple signatures:
multiprocessing.Process([group[, target[, name[, args[, kwargs]]]]], *, daemon=None)
I put my preferred rendering in the patch, but Sphinx re-renders it in its own way.
I also noticed these more unusual signatures:
urllib.request.urlopen(url, data=None[, timeout], *, cafile=None, capath=None, cadefault=True)
http.client.HTTPSConnection(host, port=None, key_file=None, cert_file=None[, strict[, timeout[, source_address]]], *, context=None, check_hostname=None)
By the way, is the * really necessary in these examples? |
|