[issue31828] Support Py_tss_NEEDS_INIT outside of static initialisation

2017-10-26 Thread Erik Bray
Change by Erik Bray : -- nosy: +erik.bray ___ Python tracker ___ ___ Python-bugs-list

[issue31828] Support Py_tss_NEEDS_INIT outside of static initialisation

2017-10-23 Thread Masayuki Yamamoto
Change by Masayuki Yamamoto : -- keywords: +patch pull_requests: +4067 stage: -> patch review ___ Python tracker ___

[issue31828] Support Py_tss_NEEDS_INIT outside of static initialisation

2017-10-22 Thread Nick Coghlan
Nick Coghlan added the comment: For the wording fix, since it's just a trivial docs update, we can go ahead and fix it without an issue reference from the PRs. As far as the API goes, I do want to support "static Py_tss_t my_tss_key = Py_tss_NEEDS_INIT;" in third party

[issue31828] Support Py_tss_NEEDS_INIT outside of static initialisation

2017-10-22 Thread Masayuki Yamamoto
Masayuki Yamamoto added the comment: Or Py_tss_NEEDS_INIT is removed from the C API document to become a private feature; in other words, the Python interpreter will recommend that the static allocation for the TSS key shouldn't be used in the API client codes

[issue31828] Support Py_tss_NEEDS_INIT outside of static initialisation

2017-10-21 Thread Nick Coghlan
Nick Coghlan added the comment: Right, the cases we were aiming to cover were: - C variable declarations ("static Py_tss_t tss_key = Py_tss_NEEDS_INIT;") - dynamic allocation with PyThread_tss_alloc - resetting a key back to the uninitialised state with PyThread_tss_delete

[issue31828] Support Py_tss_NEEDS_INIT outside of static initialisation

2017-10-20 Thread Stefan Behnel
New submission from Stefan Behnel : Following up on issue 25658, it was found that the current definition of Py_tss_NEEDS_INIT restricts its use to initialisers in C and cannot be used for arbitrary assignments. It is currently declared as follows: #define