[issue39968] port extension modules' macros of `get_module_state()` to inline function.

2020-03-16 Thread STINNER Victor
STINNER Victor added the comment: > This macOS job should be enhanced? setup.py skips optional dependencies like readline on purpose. readline is built again onx86-64 macOS 3.x buildbot worker and test_readline passed. I close the issue. Thanks for the quick fix. -- resolution:

[issue39968] port extension modules' macros of `get_module_state()` to inline function.

2020-03-16 Thread hai shi
hai shi added the comment: > Oh, macOS job was marked as success on PR 19017 :-( yeah, it's weird. This macOS job should be enhanced? -- ___ Python tracker ___

[issue39968] port extension modules' macros of `get_module_state()` to inline function.

2020-03-16 Thread STINNER Victor
STINNER Victor added the comment: > Compile is failure after PR 19017 is merged on macOS. Oh, macOS job was marked as success on PR 19017 :-( https://github.com/python/cpython/runs/509226542 But I confirm that I can read there: """ Failed to build these modules: _tkinter

[issue39968] port extension modules' macros of `get_module_state()` to inline function.

2020-03-16 Thread STINNER Victor
STINNER Victor added the comment: New changeset 5f104d56fa10f88098338b3f1ea74bcbe6924ca9 by Hai Shi in branch 'master': bpo-39968: Fix a typo error in get_readline_state() (GH-19028) https://github.com/python/cpython/commit/5f104d56fa10f88098338b3f1ea74bcbe6924ca9 --

[issue39968] port extension modules' macros of `get_module_state()` to inline function.

2020-03-16 Thread hai shi
hai shi added the comment: > See also: https://github.com/python/cpython/runs/509226542#step:4:305 Oh, thanks, Dong-hee Na. I create a PR for this typo error. -- ___ Python tracker

[issue39968] port extension modules' macros of `get_module_state()` to inline function.

2020-03-16 Thread hai shi
Change by hai shi : -- pull_requests: +18377 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/19028 ___ Python tracker ___

[issue39968] port extension modules' macros of `get_module_state()` to inline function.

2020-03-16 Thread Dong-hee Na
Dong-hee Na added the comment: I reopen this issue for the above problem -- resolution: fixed -> status: closed -> open ___ Python tracker ___

[issue39968] port extension modules' macros of `get_module_state()` to inline function.

2020-03-16 Thread Dong-hee Na
Dong-hee Na added the comment: See also: https://github.com/python/cpython/runs/509226542#step:4:305 -- ___ Python tracker ___ ___

[issue39968] port extension modules' macros of `get_module_state()` to inline function.

2020-03-16 Thread Dong-hee Na
Dong-hee Na added the comment: > cpython/Modules/readline.c:90:20: error: unknown type name 'PyModule' get_readline_state(PyModule *module) Compile is failure after PR 19017 is merged on macOS. -- nosy: +corona10 ___ Python tracker

[issue39968] port extension modules' macros of `get_module_state()` to inline function.

2020-03-16 Thread hai shi
hai shi added the comment: Wow, thanks, victor. those msgs is very helpful to me. -- ___ Python tracker ___ ___ Python-bugs-list

[issue39968] port extension modules' macros of `get_module_state()` to inline function.

2020-03-16 Thread STINNER Victor
STINNER Victor added the comment: Oh, I forgot a cool advantage that I discovered late: debuggers and profilers understand inlined code and are able to get the name of the static inline function, whereas it's not possible to do that with macros. If I recall correctly, it works even if the

[issue39968] port extension modules' macros of `get_module_state()` to inline function.

2020-03-16 Thread STINNER Victor
STINNER Victor added the comment: Note: Hai Shi is working hard on converting modules to multiphase module initialization (PEP 489) which helps to cleanup the Python state at exit, and subinterpreters will likely benefit of that. This issue is related to this work. --

[issue39968] port extension modules' macros of `get_module_state()` to inline function.

2020-03-16 Thread STINNER Victor
STINNER Victor added the comment: There are multiple good reasons to replace macros with static inline functions: * Parameter types and return value are well defined * Less error-prone: avoid completely https://gcc.gnu.org/onlinedocs/gcc-9.3.0/cpp/Macro-Pitfalls.html#Macro-Pitfalls *

[issue39968] port extension modules' macros of `get_module_state()` to inline function.

2020-03-16 Thread STINNER Victor
STINNER Victor added the comment: New changeset f707d94af68a15afc27c1a9da5835f9456259fea by Hai Shi in branch 'master': bpo-39968: Convert extension modules' macros of get_module_state() to inline functions (GH-19017)

[issue39968] port extension modules' macros of `get_module_state()` to inline function.

2020-03-15 Thread Raymond Hettinger
Raymond Hettinger added the comment: Tim, do you approve of this kind of wholesale macro-to-inline function conversion? My thought is that in most cases, there is no advantage to conversion and that sometimes there will be minor disadvantage in code generation when the macro is used across

[issue39968] port extension modules' macros of `get_module_state()` to inline function.

2020-03-15 Thread hai shi
Change by hai shi : -- title: move extension modules' macros of `get_module_state()` to inline function. -> port extension modules' macros of `get_module_state()` to inline function. ___ Python tracker