[issue26282] Add support for partial keyword arguments in extension functions

2016-06-10 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26282] Add support for partial keyword arguments in extension functions

2016-06-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 69c0aa8a8185 by Serhiy Storchaka in branch 'default':
Issue #26282: PyArg_ParseTupleAndKeywords() and Argument Clinic now support
https://hg.python.org/cpython/rev/69c0aa8a8185

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26282] Add support for partial keyword arguments in extension functions

2016-05-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

On new patch applied Martin's suggestions, added entities in What's New and 
NEWS, added a reference to the glossary, and improved error message.

--
Added file: 
http://bugs.python.org/file42779/pyarg_parse_positional_only_and_keywords_3.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26282] Add support for partial keyword arguments in extension functions

2016-05-08 Thread Martin Panter

Martin Panter added the comment:

I made some suggestions in the documentation. I only skimmed over the C and arg 
clinic code, but there is nothing obviously wrong.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26282] Add support for partial keyword arguments in extension functions

2016-05-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If there are no objections I'm inclined to commit 
pyarg_parse_positional_only_and_keywords_2.patch in short time.

--
assignee:  -> serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26282] Add support for partial keyword arguments in extension functions

2016-05-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

For example here is a patch that partially reverts issue26243 by making "data" 
positional parameter, but keeping "level" positional-or-keyword parameter.

--
Added file: 
http://bugs.python.org/file42682/zlib_compress_positional_only_data.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26282] Add support for partial keyword arguments in extension functions

2016-05-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Removed development code from tests (thanks Martin for catching this) and adds 
support in Argument Clinic. Now the patch is complete and ready for final 
review.

--
components: +Argument Clinic, Interpreter Core
stage:  -> patch review
Added file: 
http://bugs.python.org/file42681/pyarg_parse_positional_only_and_keywords_2.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26282] Add support for partial keyword arguments in extension functions

2016-02-12 Thread Anish Shah

Changes by Anish Shah :


--
nosy:  -anish.shah

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26282] Add support for partial keyword arguments in extension functions

2016-02-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Proposed patch adds support for positional-only parameters in 
PyArg_ParseTupleAndKeywords(). It is simple, the most complex part is 
generating detailed error message for the case of calling with insufficient 
number of positional arguments.

--
keywords: +patch
Added file: 
http://bugs.python.org/file41868/pyarg_parse_positional_only_and_keywords.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26282] Add support for partial keyword arguments in extension functions

2016-02-07 Thread Raymond Hettinger

Raymond Hettinger added the comment:

+1 for this suggestion.  There are a number of places where we've been trapped 
between having no keyword arguments or having to use keywords for all arguments 
even when it doesn't make sense to have all arguments be keywords.

--
nosy: +rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26282] Add support for partial keyword arguments in extension functions

2016-02-03 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Currently extension functions either accept only positional-only arguments 
(PyArg_ParseTuple), or keyword arguments (PyArg_ParseTupleAndKeywords). While 
adding support passing by keywords looks good for some arguments, for other 
arguments it doesn't make much sense. For example "encoding" and "errors" 
arguments for str or "base" argument for int are examples of good keyword 
arguments, but it is hard to choose good name for the first argument.

I suggest to allow to add the support of keyword arguments only for the part of 
arguments, while left other arguments positional-only. This issue consists from 
two stages:

1. Allow PyArg_ParseTupleAndKeywords to accept empty string "" as keywords and 
interpret this as positional-only argument.

2. Make Argument Clinic to generate code for partial keyword arguments. The 
syntax already supports this: "/" separates positional-only arguments from 
keyword arguments.

--
messages: 259521
nosy: larry, martin.panter, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Add support for partial keyword arguments in extension functions
type: enhancement
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26282] Add support for partial keyword arguments in extension functions

2016-02-03 Thread Martin Panter

Martin Panter added the comment:

For the examples you gave, they already seem to support keywords for the first 
parameter: int(x=0), str(object=""), bytes(source=b""). Maybe it is a bit 
unfortunate that they are inconsistent, but these names seem reasonable when 
considered separately.

But I agree that in those cases having the option of a keyword would rarely be 
useful. This proposal sounds like it could give a small benefit, and I guess it 
wouldn’t be costly to implement.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26282] Add support for partial keyword arguments in extension functions

2016-02-03 Thread Anish Shah

Changes by Anish Shah :


--
nosy: +anish.shah

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com