Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 33.9k
bpo-36876: Make some static string literal arrays constant.#15760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Conversation
ericsnowcurrently commented Sep 9, 2019 • edited by bedevere-bot
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by bedevere-bot
Uh oh!
There was an error while loading. Please reload this page.
pganssle left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall, a few formatting nits around whitespace I found.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few other alignment issues like the ones above - probably best to align the newline escapes as above.
bedevere-bot commented Sep 9, 2019
When you're done making the requested changes, leave the comment: |
Uh oh!
There was an error while loading. Please reload this page.
pganssle left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are all the alignment issues I found. Hopefully the "suggestions" are the right number of spaces.
| intaccess= (access_mode)ACCESS_DEFAULT; | ||
| DWORDflProtect, dwDesiredAccess; | ||
| staticchar*keywords[] ={"fileno", "length", | ||
| staticconstchar*keywords[] ={"fileno", "length", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Next two lines are also misaligned.
| /* Beware that "in" clashes with Python's own "in" operator keyword */ | ||
| staticchar*keywords[] ={"out", "in", | ||
| staticconstchar*keywords[] ={"out", "in", | ||
| "offset", "count", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alignment here again.
| Py_ssize_tcount; | ||
| PyObject*offobj; | ||
| staticchar*keywords[] ={"out", "in", | ||
| staticconstchar*keywords[] ={"out", "in", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alignment again.
Uh oh!
There was an error while loading. Please reload this page.
| { | ||
| staticchar*kwd_list[] ={"message", "category", "filename", "lineno", | ||
| staticconstchar*kwd_list[] ={"message", "category", "filename", "lineno", | ||
| "module", "registry", "module_globals", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alignment here again.
serhiy-storchaka commented Sep 10, 2019
Changing It is possible to change the API, but it is long a complex process. It is a separate issue. Adding consts in |
serhiy-storchaka commented Sep 10, 2019
Note also that you can add two See #15824 for changes in |
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>
ericsnowcurrently commented Sep 10, 2019
Hmm, this won't work out. |
georgthegreat commented Feb 24, 2021
georgthegreat commented Feb 25, 2021
@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 |
This gives us guarantees about immutability.
https://bugs.python.org/issue36876