[issue39487] Merge duplicated _Py_IDENTIFIER identifiers in C code

2020-01-30 Thread Brett Cannon
Brett Cannon added the comment: I just merged Hai Shi's PR, so I'm going to close assuming that took care of all the instances. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue39487] Merge duplicated _Py_IDENTIFIER identifiers in C code

2020-01-30 Thread Brett Cannon
Brett Cannon added the comment: New changeset 46874c26ee1fc752e2e6930efa1d223b2351edb8 by Hai Shi in branch 'master': bpo-39487: Merge duplicated _Py_IDENTIFIER identifiers in C code (GH-18254) https://github.com/python/cpython/commit/46874c26ee1fc752e2e6930efa1d223b2351edb8 --

[issue39487] Merge duplicated _Py_IDENTIFIER identifiers in C code

2020-01-30 Thread hai shi
hai shi added the comment: If i understand clearly, msg360993 is an solution of issue39465. -- ___ Python tracker ___ ___

[issue39487] Merge duplicated _Py_IDENTIFIER identifiers in C code

2020-01-29 Thread STINNER Victor
STINNER Victor added the comment: > That means this is a useful refactoring to help identify blockers to full > subinterpreter support. I don't think that subinterpreter support should block this issue, since currently, _Py_IDENTIFIER() does *not* support subinterpreters. > In the

[issue39487] Merge duplicated _Py_IDENTIFIER identifiers in C code

2020-01-29 Thread Nick Coghlan
Nick Coghlan added the comment: In the subinterpreter context: perhaps it would make sense to move *all* Py_IDENTIFIER declarations to file scope? That would make it much clearer which of our extension modules actually have hidden state for caching purposes. If we did that though, we'd

[issue39487] Merge duplicated _Py_IDENTIFIER identifiers in C code

2020-01-29 Thread Nick Coghlan
Nick Coghlan added the comment: My apologies, my comment above was based on an outdated understanding of how the identifier structs get initialised (it's the usage that initialises them, not the declaration). That means this is a useful refactoring to help identify blockers to full

[issue39487] Merge duplicated _Py_IDENTIFIER identifiers in C code

2020-01-29 Thread Nick Coghlan
Nick Coghlan added the comment: We can't make this change, as it means the statics get initialised before the Python interpreter has been initialised, and won't be reinitialised if the interpreter is destroyed and recreated. -- nosy: +ncoghlan resolution: -> rejected stage: patch

[issue39487] Merge duplicated _Py_IDENTIFIER identifiers in C code

2020-01-29 Thread Eric Snow
Eric Snow added the comment: FTR: As Martin noted in #19514, there isn't any performance difference for statics, whether local or global. For static locals the compiler (at least on linux) generates symbols named as ".<#>" and they are treated as global. One key difference (again, at

[issue39487] Merge duplicated _Py_IDENTIFIER identifiers in C code

2020-01-29 Thread hai shi
Change by hai shi : -- nosy: +vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39487] Merge duplicated _Py_IDENTIFIER identifiers in C code

2020-01-29 Thread hai shi
Change by hai shi : -- keywords: +patch pull_requests: +17631 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18254 ___ Python tracker ___

[issue39487] Merge duplicated _Py_IDENTIFIER identifiers in C code

2020-01-29 Thread hai shi
New submission from hai shi : As stinner said in issue19514 those _Py_IDENTIFIER should be merged: ./Modules/_ctypes/_ctypes.c:1054:_Py_IDENTIFIER(_type_); ./Modules/_ctypes/_ctypes.c:1132:_Py_IDENTIFIER(_type_); ./Modules/_ctypes/_ctypes.c:1494:_Py_IDENTIFIER(_type_);