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 2012年03月15日 21:49 by larry, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| larry.parsekwonly.diff.2.txt | larry, 2012年03月15日 21:49 | review | ||
| larry.parsekwonly.diff.3.txt | larry, 2012年03月16日 06:34 | review | ||
| larry.parsekwonly.diff.4.txt | larry, 2012年03月17日 07:59 | review | ||
| larry.parsekwonly.diff.5.txt | larry, 2012年03月17日 17:56 | review | ||
| larry.parsekwonly.diff.7.txt | larry, 2012年03月20日 01:43 | review | ||
| Messages (16) | |||
|---|---|---|---|
| msg155961 - (view) | Author: Larry Hastings (larry) * (Python committer) | Date: 2012年03月15日 21:49 | |
This has been split off from #14127 at Antoine's request. The attached patch adds support for keyword-only arguments to the PyArg_ParseTupleAndKeywords() family of functions. Includes doc and test. I used '$' to indicate "all parameters after this are keyword-only"; since they must also be optional it must follow a '|'. (I would have used '*' but we already use that for 'U*' 's* etc.) The patch already received one review from Greg P. Smith on the previous issue; the patch I'm attaching here is the second revision incorporating his suggestions. |
|||
| msg155964 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2012年03月15日 21:54 | |
Why do you force them to be optional? |
|||
| msg155965 - (view) | Author: Larry Hastings (larry) * (Python committer) | Date: 2012年03月15日 21:59 | |
It frankly never occurred to me that you'd want mandatory keyword-only arguments. Implementing them as optional-only was easy; I'm not sure but making them possibly mandatory (or both!) might complicate matters. Is there a use case for 'em? |
|||
| msg155966 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2012年03月15日 22:01 | |
2012年3月15日 Larry Hastings <report@bugs.python.org>: > > Larry Hastings <larry@hastings.org> added the comment: > > It frankly never occurred to me that you'd want mandatory keyword-only arguments. Implementing them as optional-only was easy; I'm not sure but making them possibly mandatory (or both!) might complicate matters. > > Is there a use case for 'em? No idea, but at some point we might want them and it parallels the Python interface. |
|||
| msg155968 - (view) | Author: Larry Hastings (larry) * (Python committer) | Date: 2012年03月15日 22:03 | |
How about we leave it for now, and if we need it later we can fix the implementation. Adding that feature won't break existing calls--we'll just permit $ to occur before/without | in the format string. |
|||
| msg155979 - (view) | Author: Larry Hastings (larry) * (Python committer) | Date: 2012年03月16日 00:36 | |
BTW, I have the os.utime patch nearly ready for review; it works, it just needs doc and test. But it's dependent on this patch--and it'd be smoother if #14127 were finished too. So I'll hold off on posting the new patch until the fates of these two are decided. |
|||
| msg155987 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2012年03月16日 01:21 | |
I want #14325 to go in first. |
|||
| msg155998 - (view) | Author: Larry Hastings (larry) * (Python committer) | Date: 2012年03月16日 06:34 | |
Attached is r3 of my patch incorporated Benjamin's suggestions. > I want #14325 to go in first. Why do you care? If I get signoff before 14325 does please explain to me why I should wait. They don't touch the same lines; should be a clean merge no matter who goes first. |
|||
| msg156060 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2012年03月16日 17:32 | |
Shouldn't using vgetargs1 with '$' in the format string just be an error? vgetargs1 doesn't know anything about keyword arguments. |
|||
| msg156145 - (view) | Author: Larry Hastings (larry) * (Python committer) | Date: 2012年03月17日 07:59 | |
> Shouldn't using vgetargs1 with '$' in the format string just be > an error? vgetargs1 doesn't know anything about keyword arguments. Thank you for catching that! Serves me right for search-and-destroy style development--I'm not that familiar with getargs.c. Fixed, which is to say I removed that gunk, in attached patch #4 against current trunk. |
|||
| msg156186 - (view) | Author: Larry Hastings (larry) * (Python committer) | Date: 2012年03月17日 17:56 | |
Incorporated the latest round of suggestions from Benjamin's most recent--and very thorough!--review. Thanks, Benjamin! |
|||
| msg156361 - (view) | Author: Larry Hastings (larry) * (Python committer) | Date: 2012年03月19日 21:48 | |
Anyone else? Or can I get the go-ahead? |
|||
| msg156362 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2012年03月19日 21:49 | |
Did you not see Georg's comments? |
|||
| msg156376 - (view) | Author: Larry Hastings (larry) * (Python committer) | Date: 2012年03月20日 01:43 | |
Whoops! Actually, I did. But then I promptly forgot about them. They're now all incorporated; please see attached patch. |
|||
| msg156377 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2012年03月20日 01:44 | |
Fine with me now. 2012年3月19日 Larry Hastings <report@bugs.python.org>: > > Larry Hastings <larry@hastings.org> added the comment: > > Whoops! Actually, I did. But then I promptly forgot about them. They're now all incorporated; please see attached patch. > > ---------- > Added file: http://bugs.python.org/file24955/larry.parsekwonly.diff.7.txt > > _______________________________________ > Python tracker <report@bugs.python.org> > <http://bugs.python.org/issue14328> > _______________________________________ |
|||
| msg156454 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年03月20日 20:06 | |
New changeset 052779d34945 by Larry Hastings in branch 'default': Issue #14328: Add keyword-only parameters to PyArg_ParseTupleAndKeywords. http://hg.python.org/cpython/rev/052779d34945 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:28 | admin | set | github: 58536 |
| 2012年03月20日 20:08:02 | larry | set | status: open -> closed keywords: - patch resolution: fixed stage: patch review -> resolved |
| 2012年03月20日 20:06:29 | python-dev | set | nosy:
+ python-dev messages: + msg156454 |
| 2012年03月20日 01:44:37 | benjamin.peterson | set | messages: + msg156377 |
| 2012年03月20日 01:43:15 | larry | set | files:
+ larry.parsekwonly.diff.7.txt messages: + msg156376 |
| 2012年03月19日 21:49:36 | benjamin.peterson | set | messages: + msg156362 |
| 2012年03月19日 21:48:30 | larry | set | messages: + msg156361 |
| 2012年03月17日 17:56:57 | larry | set | files:
+ larry.parsekwonly.diff.5.txt messages: + msg156186 |
| 2012年03月17日 07:59:47 | larry | set | files:
+ larry.parsekwonly.diff.4.txt messages: + msg156145 |
| 2012年03月16日 17:32:25 | benjamin.peterson | set | messages: + msg156060 |
| 2012年03月16日 06:34:42 | larry | set | files:
+ larry.parsekwonly.diff.3.txt messages: + msg155998 |
| 2012年03月16日 01:21:31 | benjamin.peterson | set | messages: + msg155987 |
| 2012年03月16日 01:05:26 | eric.snow | set | nosy:
+ eric.snow |
| 2012年03月16日 00:36:38 | larry | set | messages: + msg155979 |
| 2012年03月15日 22:03:59 | larry | set | messages: + msg155968 |
| 2012年03月15日 22:02:58 | Arfrever | set | nosy:
+ Arfrever |
| 2012年03月15日 22:01:37 | benjamin.peterson | set | messages: + msg155966 |
| 2012年03月15日 21:59:02 | larry | set | messages: + msg155965 |
| 2012年03月15日 21:54:57 | benjamin.peterson | set | nosy:
+ benjamin.peterson messages: + msg155964 |
| 2012年03月15日 21:49:18 | larry | create | |