[issue39573] [C API] Make PyObject an opaque structure in the limited C API

2020-12-01 Thread Andy Lester
Change by Andy Lester : -- nosy: -petdance ___ Python tracker <https://bugs.python.org/issue39573> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-07-08 Thread Andy Lester
Change by Andy Lester : -- nosy: -petdance ___ Python tracker <https://bugs.python.org/issue40170> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40902] Speed up PEG parser by using operator precedence for binary operators

2020-06-07 Thread Andy Lester
Change by Andy Lester : -- nosy: +petdance ___ Python tracker <https://bugs.python.org/issue40902> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40770] RFE: Run linkchecker on documentation on the CI

2020-05-28 Thread Andy Lester
Andy Lester added the comment: Some high-level questions to consider: * Is it run only when a build of the docs is started? Or should it be done regularly (daily/weekly?) to keep an eye on links so that it's not a surprise when build time comes along? * Does a broken link stop the build

[issue40770] RFE: Run linkchecker on documentation on the CI

2020-05-25 Thread Andy Lester
Change by Andy Lester : -- nosy: +petdance ___ Python tracker <https://bugs.python.org/issue40770> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40344] Programming FAQ about "What is the most efficient way to concatenate many strings together?" -- Improving the example

2020-05-24 Thread Andy Lester
Andy Lester added the comment: I'd also like to suggest that the question not be "most efficient" but "fastest". I don't think it should treat "efficient" and "fast" as synonyms. "Efficient" can mean things other than executio

[issue40455] GCC 10 compiler warnings

2020-05-04 Thread Andy Lester
Andy Lester added the comment: For anyone following along, note that the PR above is different than the original suggestion. The PR correctly sets x_size, not leaving it zero. -- ___ Python tracker <https://bugs.python.org/issue40

[issue40455] GCC 10 compiler warnings

2020-04-30 Thread Andy Lester
Andy Lester added the comment: Did you add any options to the ./configure call for cpython? What were they? -- ___ Python tracker <https://bugs.python.org/issue40

[issue40455] GCC 10 compiler warnings

2020-04-30 Thread Andy Lester
Change by Andy Lester : -- nosy: +petdance ___ Python tracker <https://bugs.python.org/issue40455> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40344] Programming FAQ about "What is the most efficient way to concatenate many strings together?" -- Improving the example

2020-04-20 Thread Andy Lester
Change by Andy Lester : -- nosy: +petdance ___ Python tracker <https://bugs.python.org/issue40344> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40314] python code order of magnitude faster than equivalent CPython code for simple import statement

2020-04-17 Thread Andy Lester
Change by Andy Lester : -- nosy: +petdance ___ Python tracker <https://bugs.python.org/issue40314> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39943] Meta: Clean up various issues in C internals

2020-04-16 Thread Andy Lester
Andy Lester added the comment: I'm assuming that you're getting this sre_lib.h error when compiling Modules/_sre.c. -- ___ Python tracker <https://bugs.python.org/issue39

[issue39943] Meta: Clean up various issues in C internals

2020-04-14 Thread Andy Lester
Andy Lester added the comment: I remember coming across a similar error from GCC about casting from a const double pointer to a single pointer void and it said (I believe) something about having to have each cast having to be valid. I think it was implying something like that if you have

[issue40245] Add description meta tags to docs.python.org

2020-04-10 Thread Andy Lester
Change by Andy Lester : -- nosy: +petdance ___ Python tracker <https://bugs.python.org/issue40245> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39943] Meta: Clean up various issues in C internals

2020-04-08 Thread Andy Lester
Change by Andy Lester : -- pull_requests: +18800 pull_request: https://github.com/python/cpython/pull/19445 ___ Python tracker <https://bugs.python.org/issue39

[issue39943] Meta: Clean up various issues in C internals

2020-04-06 Thread Andy Lester
Change by Andy Lester : -- pull_requests: +18766 pull_request: https://github.com/python/cpython/pull/19405 ___ Python tracker <https://bugs.python.org/issue39

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-03 Thread Andy Lester
Change by Andy Lester : -- nosy: +petdance ___ Python tracker <https://bugs.python.org/issue40170> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39943] Meta: Clean up various issues in C internals

2020-04-02 Thread Andy Lester
Change by Andy Lester : -- pull_requests: +18692 pull_request: https://github.com/python/cpython/pull/19327 ___ Python tracker <https://bugs.python.org/issue39

[issue39943] Meta: Clean up various issues in C internals

2020-03-28 Thread Andy Lester
Change by Andy Lester : -- pull_requests: +18573 pull_request: https://github.com/python/cpython/pull/19210 ___ Python tracker <https://bugs.python.org/issue39

[issue39943] Meta: Clean up various issues in C internals

2020-03-28 Thread Andy Lester
Change by Andy Lester : -- pull_requests: +18572 pull_request: https://github.com/python/cpython/pull/19209 ___ Python tracker <https://bugs.python.org/issue39

[issue39943] Meta: Clean up various issues in C internals

2020-03-27 Thread Andy Lester
Andy Lester added the comment: Casting tail to (void *)tail was the correct thing to do. The problem is that casting to void* casts away the constness of tail. The even more correct thing to do is what my patch does, which is cast it to (const void *)tail. There is no functional

[issue39908] Remove unused args from init_set_builtins_open and _Py_FatalError_PrintExc in Python/pylifecycle.c

2020-03-26 Thread Andy Lester
Change by Andy Lester : -- stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue39908> ___ ___ Pyth

[issue39943] Meta: Clean up various issues in C internals

2020-03-26 Thread Andy Lester
Andy Lester added the comment: It doesn't quiet any compiler warnings given the default compiler warnings that ./configure sets. However, it does quiet the -Wcast-qual compiler warning that could be a helpful addition some time in the future. I think it would be great, for example

[issue39943] Meta: Clean up various issues in C internals

2020-03-26 Thread Andy Lester
Change by Andy Lester : -- pull_requests: +18545 pull_request: https://github.com/python/cpython/pull/19186 ___ Python tracker <https://bugs.python.org/issue39

[issue39943] Meta: Clean up various issues in C internals

2020-03-26 Thread Andy Lester
Change by Andy Lester : -- pull_requests: +18544 pull_request: https://github.com/python/cpython/pull/19185 ___ Python tracker <https://bugs.python.org/issue39

[issue39943] Meta: Clean up various issues in C internals

2020-03-25 Thread Andy Lester
Change by Andy Lester : -- pull_requests: +18530 pull_request: https://github.com/python/cpython/pull/19170 ___ Python tracker <https://bugs.python.org/issue39

[issue39943] Meta: Clean up various issues in C internals

2020-03-24 Thread Andy Lester
Change by Andy Lester : -- pull_requests: +18513 pull_request: https://github.com/python/cpython/pull/19152 ___ Python tracker <https://bugs.python.org/issue39

[issue39943] Meta: Clean up various issues in C internals

2020-03-12 Thread Andy Lester
Change by Andy Lester : -- pull_requests: +18322 pull_request: https://github.com/python/cpython/pull/18973 ___ Python tracker <https://bugs.python.org/issue39

[issue39943] Meta: Clean up various issues in C internals

2020-03-11 Thread Andy Lester
Change by Andy Lester : -- keywords: +patch pull_requests: +18301 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18950 ___ Python tracker <https://bugs.python.org/issu

[issue39922] Remove unused args in Python/compile.c

2020-03-11 Thread Andy Lester
Change by Andy Lester : -- pull_requests: -18300 ___ Python tracker <https://bugs.python.org/issue39922> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39922] Remove unused args in Python/compile.c

2020-03-11 Thread Andy Lester
Change by Andy Lester : -- pull_requests: +18300 pull_request: https://github.com/python/cpython/pull/18949 ___ Python tracker <https://bugs.python.org/issue39

[issue39943] Meta: Clean up various issues in C internals

2020-03-11 Thread Andy Lester
Change by Andy Lester : -- title: Meta: Clean up various issues -> Meta: Clean up various issues in C internals ___ Python tracker <https://bugs.python.org/issu

[issue39943] Meta: Clean up various issues

2020-03-11 Thread Andy Lester
New submission from Andy Lester : This is a meta-ticket for a number of small PRs that clean up some internals. Issues will include: * Removing unnecessary casts * consting pointers that can be made const * Removing unused function arguments * etc -- components: Interpreter Core

[issue39922] Remove unused args in Python/compile.c

2020-03-10 Thread Andy Lester
Andy Lester added the comment: Sorry about the noise. I will do that. Yes, I have a bunch more to submit. -- ___ Python tracker <https://bugs.python.org/issue39

[issue39922] Remove unused args in Python/compile.c

2020-03-09 Thread Andy Lester
Change by Andy Lester : -- keywords: +patch pull_requests: +18250 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18893 ___ Python tracker <https://bugs.python.org/issu

[issue39896] Const args and remove unused args in Python/compile.c

2020-03-09 Thread Andy Lester
Andy Lester added the comment: Replaced by https://bugs.python.org/issue39922 -- resolution: -> rejected stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue39922] Remove unused args in Python/compile.c

2020-03-09 Thread Andy Lester
New submission from Andy Lester : These functions have unnecessary args that can be removed: * binop * compiler_add_o * compiler_next_instr * inplace_binop -- components: Interpreter Core messages: 363799 nosy: petdance priority: normal severity: normal status: open title: Remove

[issue39908] Remove unused args from init_set_builtins_open and _Py_FatalError_PrintExc in Python/pylifecycle.c

2020-03-08 Thread Andy Lester
Change by Andy Lester : -- keywords: +patch pull_requests: +18225 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18867 ___ Python tracker <https://bugs.python.org/issu

[issue39908] Remove unused args from init_set_builtins_open and _Py_FatalError_PrintExc in Python/pylifecycle.c

2020-03-08 Thread Andy Lester
New submission from Andy Lester : init_set_builtins_open(PyThreadState *tstate) -> unused arg _Py_FatalError_PrintExc(int fd) -> unused arg -- components: Interpreter Core messages: 363690 nosy: petdance priority: normal severity: normal status: open title: Remove unused arg

[issue39898] Remove unused arg from append_formattedvalue in Python/ast_unparse.c

2020-03-07 Thread Andy Lester
Change by Andy Lester : -- keywords: +patch pull_requests: +18197 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18840 ___ Python tracker <https://bugs.python.org/issu

[issue39898] Remove unused arg from append_formattedvalue in Python/ast_unparse.c

2020-03-07 Thread Andy Lester
New submission from Andy Lester : append_formattedvalue() has an unused bool is_format_spec. -- components: Interpreter Core messages: 363634 nosy: petdance priority: normal severity: normal status: open title: Remove unused arg from append_formattedvalue in Python/ast_unparse.c

[issue39896] Const args and remove unused args in Python/compile.c

2020-03-07 Thread Andy Lester
Change by Andy Lester : -- keywords: +patch pull_requests: +18194 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18837 ___ Python tracker <https://bugs.python.org/issu

[issue39896] Const args and remove unused args in Python/compile.c

2020-03-07 Thread Andy Lester
New submission from Andy Lester : Remove unused args from: * binop * compiler_next_instr * inplace_binop Const arguments for: * assemble_jump_offsets * blocksize * check_caller * check_compare * check_index * check_is_arg * check_subscripter * compiler_error * compiler_new_block

[issue39886] Remove unused arg in config_get_stdio_errors in Python/initconfig.c

2020-03-06 Thread Andy Lester
Change by Andy Lester : -- keywords: +patch pull_requests: +18182 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18823 ___ Python tracker <https://bugs.python.org/issu

[issue39886] Remove unused arg in config_get_stdio_errors in Python/initconfig.c

2020-03-06 Thread Andy Lester
New submission from Andy Lester : config_get_stdio_errors(const PyConfig *config) does not use its arg. Delete it. -- components: Interpreter Core messages: 363582 nosy: petdance priority: normal severity: normal status: open title: Remove unused arg in config_get_stdio_errors

[issue39878] Remove unused args in Python/formatter_unicode.c

2020-03-06 Thread Andy Lester
Change by Andy Lester : -- pull_requests: +18181 pull_request: https://github.com/python/cpython/pull/18822 ___ Python tracker <https://bugs.python.org/issue39

[issue39127] _Py_HashPointer's void * argument should be const

2020-03-06 Thread Andy Lester
Andy Lester added the comment: Is there more to do here or can it be closed? -- ___ Python tracker <https://bugs.python.org/issue39127> ___ ___ Python-bug

[issue39878] Remove unused args in Python/formatter_unicode.c

2020-03-06 Thread Andy Lester
Change by Andy Lester : -- keywords: +patch pull_requests: +18168 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18810 ___ Python tracker <https://bugs.python.org/issu

[issue39878] Remove unused args in Python/formatter_unicode.c

2020-03-06 Thread Andy Lester
New submission from Andy Lester : The following functions have unused args: calc_number_widths -> PyObject *number fill_number -> Py_ssize_t d_end -- components: Interpreter Core messages: 363525 nosy: petdance priority: normal severity: normal status: open title: Remove unuse

[issue39573] Make PyObject an opaque structure in the limited C API

2020-03-06 Thread Andy Lester
Change by Andy Lester : -- pull_requests: +18167 pull_request: https://github.com/python/cpython/pull/18809 ___ Python tracker <https://bugs.python.org/issue39

[issue39872] Remove unused args from two functions in Python/symtable.c

2020-03-05 Thread Andy Lester
Change by Andy Lester : -- keywords: +patch pull_requests: +18156 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18800 ___ Python tracker <https://bugs.python.org/issu

[issue39872] Remove unused args from two functions in Python/symtable.c

2020-03-05 Thread Andy Lester
Andy Lester added the comment: Two functions. It's only two functions. -- title: Remove unused args from four functions in Python/symtable.c -> Remove unused args from two functions in Python/symtable.c ___ Python tracker <https://bugs.pyth

[issue39872] Remove unused args from four functions in Python/symtable.c

2020-03-05 Thread Andy Lester
New submission from Andy Lester : These four functions have unused arguments that can be removed: symtable_exit_block -> void *ast symtable_visit_annotations -> stmt_ty s symtable_exit_block -> void *ast symtable_visit_annotations -> stmt_ty s PR is forthcoming. -

[issue39573] Make PyObject an opaque structure in the limited C API

2020-03-05 Thread Andy Lester
Change by Andy Lester : -- pull_requests: +18155 pull_request: https://github.com/python/cpython/pull/18799 ___ Python tracker <https://bugs.python.org/issue39

[issue39573] Make PyObject an opaque structure in the limited C API

2020-03-05 Thread Andy Lester
Change by Andy Lester : -- pull_requests: +18154 pull_request: https://github.com/python/cpython/pull/18798 ___ Python tracker <https://bugs.python.org/issue39

[issue39870] sys_displayhook_unencodable takes an unnecessary PyThreadState * argument

2020-03-05 Thread Andy Lester
Change by Andy Lester : -- keywords: +patch pull_requests: +18152 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18796 ___ Python tracker <https://bugs.python.org/issu

[issue39870] sys_displayhook_unencodable takes an unnecessary PyThreadState * argument

2020-03-05 Thread Andy Lester
Change by Andy Lester : -- components: +Interpreter Core ___ Python tracker <https://bugs.python.org/issue39870> ___ ___ Python-bugs-list mailing list Unsub

[issue39870] sys_displayhook_unencodable takes an unnecessary PyThreadState * argument

2020-03-05 Thread Andy Lester
New submission from Andy Lester : sys_displayhook_unencodable in Python/sysmodule.c doesn't need its first argument. Remove it. -- messages: 363475 nosy: petdance priority: normal severity: normal status: open title: sys_displayhook_unencodable takes an unnecessary PyThreadState

[issue39859] set_herror should not throw away constness of hstrerror

2020-03-04 Thread Andy Lester
Change by Andy Lester : -- keywords: +patch pull_requests: +18147 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18790 ___ Python tracker <https://bugs.python.org/issu

[issue39859] set_herror should not throw away constness of hstrerror

2020-03-04 Thread Andy Lester
New submission from Andy Lester : set_herror builds a string by calling hstrerror but downcasts its return value to char *. It should be const char *. -- components: Interpreter Core messages: 363418 nosy: petdance priority: normal severity: normal status: open title: set_herror

[issue39573] Make PyObject an opaque structure in the limited C API

2020-03-04 Thread Andy Lester
Change by Andy Lester : -- pull_requests: +18146 pull_request: https://github.com/python/cpython/pull/18789 ___ Python tracker <https://bugs.python.org/issue39

[issue39803] _PyLong_FormatAdvancedWriter has an unnecessary str

2020-02-29 Thread Andy Lester
Change by Andy Lester : -- pull_requests: +18068 pull_request: https://github.com/python/cpython/pull/18709 ___ Python tracker <https://bugs.python.org/issue39

[issue39803] _PyLong_FormatAdvancedWriter has an unnecessary str

2020-02-29 Thread Andy Lester
Change by Andy Lester : -- pull_requests: -18067 ___ Python tracker <https://bugs.python.org/issue39803> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39803] _PyLong_FormatAdvancedWriter has an unnecessary str

2020-02-29 Thread Andy Lester
Change by Andy Lester : -- pull_requests: +18067 pull_request: https://github.com/python/cpython/pull/18708 ___ Python tracker <https://bugs.python.org/issue39

[issue39803] _PyLong_FormatAdvancedWriter has an unnecessary str

2020-02-29 Thread Andy Lester
Change by Andy Lester : -- pull_requests: -18066 ___ Python tracker <https://bugs.python.org/issue39803> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39803] _PyLong_FormatAdvancedWriter has an unnecessary str

2020-02-29 Thread Andy Lester
Change by Andy Lester : -- keywords: +patch pull_requests: +18066 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18707 ___ Python tracker <https://bugs.python.org/issu

[issue39803] _PyLong_FormatAdvancedWriter has an unnecessary str

2020-02-29 Thread Andy Lester
New submission from Andy Lester : _PyLong_FormatAdvancedWriter has a PyObject *str that is never used. Remove it. -- components: Interpreter Core messages: 363006 nosy: petdance priority: normal severity: normal status: open title: _PyLong_FormatAdvancedWriter has an unnecessary str

[issue39770] Remove unnecessary size calculation in array_modexec in Modules/arraymodule.c

2020-02-26 Thread Andy Lester
Change by Andy Lester : -- pull_requests: -18035 ___ Python tracker <https://bugs.python.org/issue39770> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39770] Remove unnecessary size calculation in array_modexec in Modules/arraymodule.c

2020-02-26 Thread Andy Lester
Change by Andy Lester : -- pull_requests: +18035 pull_request: https://github.com/python/cpython/pull/18673 ___ Python tracker <https://bugs.python.org/issue39

[issue39770] Remove unnecessary size calculation in array_modexec in Modules/arraymodule.c

2020-02-26 Thread Andy Lester
Change by Andy Lester : -- pull_requests: +18034 pull_request: https://github.com/python/cpython/pull/18674 ___ Python tracker <https://bugs.python.org/issue39

[issue39770] Remove unnecessary size calculation in array_modexec in Modules/arraymodule.c

2020-02-26 Thread Andy Lester
Change by Andy Lester : -- pull_requests: -18034 ___ Python tracker <https://bugs.python.org/issue39770> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39770] Remove unnecessary size calculation in array_modexec in Modules/arraymodule.c

2020-02-26 Thread Andy Lester
Change by Andy Lester : -- pull_requests: -18032 ___ Python tracker <https://bugs.python.org/issue39770> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39770] Remove unnecessary size calculation in array_modexec in Modules/arraymodule.c

2020-02-26 Thread Andy Lester
Change by Andy Lester : -- pull_requests: -18031 ___ Python tracker <https://bugs.python.org/issue39770> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39770] Remove unnecessary size calculation in array_modexec in Modules/arraymodule.c

2020-02-26 Thread Andy Lester
Change by Andy Lester : -- pull_requests: +18033 pull_request: https://github.com/python/cpython/pull/18675 ___ Python tracker <https://bugs.python.org/issue39

[issue39770] Remove unnecessary size calculation in array_modexec in Modules/arraymodule.c

2020-02-26 Thread Andy Lester
Change by Andy Lester : -- pull_requests: +18032 pull_request: https://github.com/python/cpython/pull/18674 ___ Python tracker <https://bugs.python.org/issue39

[issue39770] Remove unnecessary size calculation in array_modexec in Modules/arraymodule.c

2020-02-26 Thread Andy Lester
Change by Andy Lester : -- keywords: +patch pull_requests: +18031 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18673 ___ Python tracker <https://bugs.python.org/issu

[issue39770] Remove unnecessary size calculation in array_modexec in Modules/arraymodule.c

2020-02-26 Thread Andy Lester
New submission from Andy Lester : The array_modexec function in Modules/arraymodule.c has a loop that calculates the number of elements in the descriptors array. This size was used at one point, but is no longer. The loop can be removed. -- components: Interpreter Core messages

[issue39736] const strings in Modules/_datetimemodule.c and Modules/_testbuffer.c

2020-02-23 Thread Andy Lester
Change by Andy Lester : -- keywords: +patch pull_requests: +18003 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18637 ___ Python tracker <https://bugs.python.org/issu

[issue39736] const strings in Modules/_datetimemodule.c and Modules/_testbuffer.c

2020-02-23 Thread Andy Lester
New submission from Andy Lester : In Modules/_datetimemodule.c, the char *timespec and char *specs[] can be made const. Their contents are never modified. In ndarray_get_format in Modules/_testbuffer.c, char *fmt can be made const. -- components: Interpreter Core messages: 362565

[issue39573] Make PyObject an opaque structure in the limited C API

2020-02-21 Thread Andy Lester
Andy Lester added the comment: Just added a new PR to finish off the remaining places to use Py_IS_TYPE() https://github.com/python/cpython/pull/18601 -- ___ Python tracker <https://bugs.python.org/issue39

[issue39573] Make PyObject an opaque structure in the limited C API

2020-02-21 Thread Andy Lester
Change by Andy Lester : -- pull_requests: +17968 pull_request: https://github.com/python/cpython/pull/18601 ___ Python tracker <https://bugs.python.org/issue39

[issue39721] Fix constness of members of tok_state struct.

2020-02-21 Thread Andy Lester
Change by Andy Lester : -- keywords: +patch pull_requests: +17967 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18600 ___ Python tracker <https://bugs.python.org/issu

[issue39721] Fix constness of members of tok_state struct.

2020-02-21 Thread Andy Lester
New submission from Andy Lester : The function PyTokenizer_FromUTF8 from Parser/tokenizer.c had a comment: /* XXX: constify members. */ This patch addresses that. In the tok_state struct: * end and start were non-const but could be made const * str and input were const but should

[issue39684] PyUnicode_IsIdentifier has two if/thens that can be combined

2020-02-19 Thread Andy Lester
Change by Andy Lester : -- pull_requests: -17937 ___ Python tracker <https://bugs.python.org/issue39684> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39684] PyUnicode_IsIdentifier has two if/thens that can be combined

2020-02-19 Thread Andy Lester
Change by Andy Lester : -- pull_requests: +17947 pull_request: https://github.com/python/cpython/pull/18565 ___ Python tracker <https://bugs.python.org/issue39

[issue38691] importlib: PYTHONCASEOK should be ignored when using python3 -E

2020-02-19 Thread Andy Lester
Change by Andy Lester : -- nosy: +petdance ___ Python tracker <https://bugs.python.org/issue38691> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39684] PyUnicode_IsIdentifier has two if/thens that can be combined

2020-02-18 Thread Andy Lester
Change by Andy Lester : -- keywords: +patch pull_requests: +17937 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18557 ___ Python tracker <https://bugs.python.org/issu

[issue39684] PyUnicode_IsIdentifier has two if/thens that can be combined

2020-02-18 Thread Andy Lester
New submission from Andy Lester : These two code if/thens can be combined if (ready) { kind = PyUnicode_KIND(self); data = PyUnicode_DATA(self); } else { wstr = _PyUnicode_WSTR(self); } Py_UCS4 ch; if (ready) { ch = PyUnicode_READ(kind

[issue39573] Make PyObject an opaque structure in the limited C API

2020-02-18 Thread Andy Lester
Andy Lester added the comment: All I'm saying is that I think Py_IS_TYPE is a great idea, and that Py_IS_TYPE should take const arguments, since its arguments are not modified. If you think that should go in a different ticket, then I can make that happen

[issue39573] Make PyObject an opaque structure in the limited C API

2020-02-17 Thread Andy Lester
Andy Lester added the comment: > Would you mind to explain how it's an issue to modify PyObject* temporarily > during a function call? It's not a problem to modify the PyObject* during a function call. However, many functions don't need to modify the object, but are still taking non

[issue39573] Make PyObject an opaque structure in the limited C API

2020-02-15 Thread Andy Lester
Andy Lester added the comment: I'm hoping that a goal here is to make static inline int _Py_IS_TYPE(PyObject *ob, PyTypeObject *type) actually be static inline int _Py_IS_TYPE(const PyObject *ob, const PyTypeObject *type) -- ___ Python tracker

[issue39573] Make PyObject an opaque structure in the limited C API

2020-02-15 Thread Andy Lester
Andy Lester added the comment: @vstinner would it be helpful if I went on a sweep looking for places we can use the new Py_IS_TYPE macro? Getting away from Py_TYPE(op) would also mean a move to making the internals const-correct. -- nosy: +petdance

[issue39630] Const some pointers to string literals

2020-02-13 Thread Andy Lester
Change by Andy Lester : -- keywords: +patch pull_requests: +17886 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18510 ___ Python tracker <https://bugs.python.org/issu

[issue39630] Const some pointers to string literals

2020-02-13 Thread Andy Lester
New submission from Andy Lester : Here are some fixes of char * pointers to literals that should be const char * in these four files. +++ Objects/frameobject.c +++ Objects/genobject.c +++ Python/codecs.c +++ Python/errors.c -- components: Interpreter Core messages: 361982 nosy

[issue39621] md5_compress() in Modules/md5module.c can take a const buf

2020-02-12 Thread Andy Lester
Change by Andy Lester : -- keywords: +patch pull_requests: +17871 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18497 ___ Python tracker <https://bugs.python.org/issu

[issue39621] md5_compress() in Modules/md5module.c can take a const buf

2020-02-12 Thread Andy Lester
New submission from Andy Lester : The function md5_compress does not modify its buffer argument. static void md5_compress(struct md5_state *md5, unsigned char *buf) buf should be const. -- components: Extension Modules messages: 361932 nosy: petdance priority: normal severity: normal

[issue39620] PyObject_GetAttrString and tp_getattr do not agree

2020-02-12 Thread Andy Lester
Andy Lester added the comment: Do you know why it was reverted? (Granted, it was 15 years ago...) It looks like the original changeset is trying to address at least two different problems with non-const string literals. My ticket here is focusing only on getattrfunc and setattrfunc

[issue39620] PyObject_GetAttrString and tp_getattr do not agree

2020-02-12 Thread Andy Lester
New submission from Andy Lester : PyObject_GetAttrString(PyObject *v, const char *name) typedef PyObject *(*getattrfunc)(PyObject *, char *) The outer PyObject_GetAttrString takes a const char *name, but then casts away the const when calling the underlying tp_getattr. This means

[issue39605] Fix some casts to not cast away const

2020-02-10 Thread Andy Lester
Change by Andy Lester : -- keywords: +patch pull_requests: +17827 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18453 ___ Python tracker <https://bugs.python.org/issu

[issue39605] Fix some casts to not cast away const

2020-02-10 Thread Andy Lester
New submission from Andy Lester : gcc -Wcast-qual turns up a number of instances of casting away constness of pointers. Some of these can be safely modified, by either: * Adding the const to the type cast, as in: -return _PyUnicode_FromUCS1((unsigned char*)s, size); +return

  1   2   >