| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Looks good overall, a few formatting nits around whitespace I found.
Sorry, something went wrong.
| dec_##MPDFUNC(PyObject *self, PyObject *args, PyObject *kwds) \ | ||
| { \ | ||
| static char *kwlist[] = {"other", "context", NULL}; \ | ||
| static const char *kwlist[] = {"other", "context", NULL}; \ |
There was a problem hiding this comment.
Few other alignment issues like the ones above - probably best to align the newline escapes as above.
Sorry, something went wrong.
|
When you're done making the requested changes, leave the comment: I have made the requested changes; please review again. |
Sorry, something went wrong.
There was a problem hiding this comment.
Here are all the alignment issues I found. Hopefully the "suggestions" are the right number of spaces.
Sorry, something went wrong.
| int access = (access_mode)ACCESS_DEFAULT; | ||
| DWORD flProtect, dwDesiredAccess; | ||
| static char *keywords[] = { "fileno", "length", | ||
| static const char *keywords[] = { "fileno", "length", |
There was a problem hiding this comment.
Next two lines are also misaligned.
Sorry, something went wrong.
| /* Beware that "in" clashes with Python's own "in" operator keyword */ | ||
| static char *keywords[] = {"out", "in", | ||
| static const char *keywords[] = {"out", "in", | ||
| "offset", "count", |
There was a problem hiding this comment.
Alignment here again.
Sorry, something went wrong.
| Py_ssize_t count; | ||
| PyObject *offobj; | ||
| static char *keywords[] = {"out", "in", | ||
| static const char *keywords[] = {"out", "in", |
There was a problem hiding this comment.
Alignment again.
Sorry, something went wrong.
| { | ||
| static char *kwd_list[] = {"message", "category", "filename", "lineno", | ||
| static const char *kwd_list[] = {"message", "category", "filename", "lineno", | ||
| "module", "registry", "module_globals", |
There was a problem hiding this comment.
Alignment here again.
Sorry, something went wrong.
|
Changing char *kwlist[] to const char *kwlist[] is incompatible change, because PyArg_ParseTupleAndKeywords() takes char ** which is not compatible with const char **. The compiler should raise warnings or even errors about this. If not this this change would be made years ago. It is possible to change the API, but it is long a complex process. It is a separate issue. Adding consts in Python/Python-ast.c may be good, but this file is generated. You should modify the generating script. |
Sorry, something went wrong.
|
Note also that you can add two consts in static char *something[]: static const char * const something[]. One for C-strings, and other for an array. See #15824 for changes in Python/Python-ast.c. |
Sorry, something went wrong.
Co-Authored-By: Paul Ganssle <p.ganssle@gmail.com>
Co-Authored-By: Paul Ganssle <p.ganssle@gmail.com>
Co-Authored-By: Paul Ganssle <p.ganssle@gmail.com>
Co-Authored-By: Paul Ganssle <p.ganssle@gmail.com>
Co-Authored-By: Paul Ganssle <p.ganssle@gmail.com>
|
Hmm, this won't work out. |
Sorry, something went wrong.
|
At the time there is a bunch of forgotten const / const_cast / (char**) c-style casts everywhere in PyArg_ParseTupleAndKeywords invocations. The list includes the following pip packages (but definitely not limited to): Is there any way to continue working on the issue? |
Sorry, something went wrong.
|
@serhiy-storchaka, could you, please, elaborate on
At the time the lack of const causes problems i. e. when compiling in MSVC standard conformance mode (which is default for /std:c++latest / /std:c++20). |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This gives us guarantees about immutability.
https://bugs.python.org/issue36876