[issue21011] PyArg_ParseTupleAndKeywords doesn't take const char *keywords[]

2018-07-03 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

We can't change this API because this would break virtually all user code.

But we can introduce a macro like PY_SSIZE_T_CLEAN. If it is defined before 
including Python.h, PyArg_ParseTupleAndKeywords() will take an array of const 
strings. This will help for compatibility with C++.

--
nosy: +serhiy.storchaka
type: resource usage -> enhancement

___
Python tracker 

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



[issue21011] PyArg_ParseTupleAndKeywords doesn't take const char *keywords[]

2018-07-03 Thread INADA Naoki


INADA Naoki  added the comment:

I think we can't fix this until Python 4.
May I close this issue as "won't fix" for now?

Or can we add "Python 4" keyword to list backward incompatible changes we want 
to do in the future?

--
nosy: +inada.naoki
versions: +Python 3.8 -Python 3.4

___
Python tracker 

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



[issue21011] PyArg_ParseTupleAndKeywords doesn't take const char *keywords[]

2014-03-25 Thread Josh Rosenberg

Josh Rosenberg added the comment:

This has come up before. Links to additional info:

https://mail.python.org/pipermail/python-dev/2006-February/060689.html

http://bugs.python.org/issue1772673

--
nosy: +josh.rosenberg

___
Python tracker 

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



[issue21011] PyArg_ParseTupleAndKeywords doesn't take const char *keywords[]

2014-03-21 Thread Hristo Venev

New submission from Hristo Venev:

This really annoys me. I have to store the literals in char[] and then make a 
char*[] from them. It would be better if a simple array of string literals 
could be used. It would also require less data space because string literals 
could be merged by the compiler.

I don't know why PyArg_ParseTupleAndKeywords would ever modify the keywords 
array so it makes absolutely no sense to me for the array not to be const 
char*[].

In all cases I have seen PyArg_ParseTupleAndKeywords being used string literals 
were converted to char* (dropping const) which is far far worse than 
inefficient code.

--
components: Extension Modules
messages: 214388
nosy: h.venev
priority: normal
severity: normal
status: open
title: PyArg_ParseTupleAndKeywords doesn't take const char *keywords[]
type: resource usage
versions: Python 3.4

___
Python tracker 

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