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.
Created on 2010年05月05日 14:28 by dabrahams, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (4) | |||
|---|---|---|---|
| msg105040 - (view) | Author: Dave Abrahams (dabrahams) | Date: 2010年05月05日 14:28 | |
Based on the rsplit documentation, I'd expect 'foo bar'.rsplit(maxsplit=1) to work. This is probably a much bigger problem than just rsplit, i.e. I doubt there is a policy about whether documented parameter names need to be usable as keywords, and if not, how one finds out which keywords are supported. |
|||
| msg105084 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2010年05月05日 20:21 | |
This is more of a documentation issue than anything else. The fact that the argument is named "maxsplit" and accepts a default value doesn't mean it's usable as a keyword argument. It would be difficult to document a parameter without giving it a name anyway... As a rule of thumb, methods accepting 2 parameters or less often don't accept any keyword arguments, since there's no point in doing so. I suggest closing this issue. |
|||
| msg124997 - (view) | Author: Sandro Tosi (sandro.tosi) * (Python committer) | Date: 2011年01月01日 11:33 | |
That's interesting: do we have a place where we explain how to read the doc? I mean, a place were we can provide example/explain how we write docs, so f.e.: str.rsplit([sep[, maxsplit]]) is a description for a method that could accept 2 optional arguments, none of them keyargs or str.encode(encoding="utf-8", errors="strict") is a description for a method that could take 2 optional args, and they are also keyargs (yeah, I know it's kinda bad-worded, but just to give the idea). If you think it's overkill, let's just close this bug (after all, we have all the doc written our way ;)). Cheers, Sandro |
|||
| msg125003 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2011年01月01日 17:52 | |
The description for the function directive is at http://docs.python.org/dev/documenting/markup.html However, I’m not sure whether the doc is accurate, since there was a switch from spam([style]) to spam(style=None) some time ago, for example in r73291. Let’s continue the discussion on the other bug. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:00 | admin | set | github: 52872 |
| 2011年01月01日 17:52:19 | eric.araujo | set | status: open -> closed superseder: Document lack of support for keyword arguments in C functions nosy: + eric.araujo messages: + msg125003 resolution: duplicate stage: resolved |
| 2011年01月01日 11:33:44 | sandro.tosi | set | nosy:
+ sandro.tosi messages: + msg124997 |
| 2010年05月05日 20:21:51 | pitrou | set | nosy:
+ docs@python, pitrou messages: + msg105084 assignee: docs@python components: + Documentation stage: test needed -> (no value) |
| 2010年05月05日 18:54:21 | brett.cannon | set | keywords:
+ easy stage: test needed |
| 2010年05月05日 14:28:09 | dabrahams | create | |