New submission from Nick Coghlan <ncogh...@gmail.com>:

After commenting [1] on the fact that the current datetime module C API [2] is 
problematic due to its reliance on C level global variables, I discovered that 
this is actually the outcome of our recommended approach to using capsules to 
export a C API as function pointers: 
https://docs.python.org/3/extending/extending.html#providing-a-c-api-for-an-extension-module

So we first need to fix the documentation to propose a reloading friendly way 
of using capsules in other extension modules, and then we can then propose 
updating the public datetime C API accordingly (probably by defining new macros 
that accept the capsule reference as their first argument).

[1] https://bugs.python.org/issue10381#msg309214
[2] https://docs.python.org/3/c-api/datetime.html
[3] 
https://docs.python.org/3/extending/extending.html#providing-a-c-api-for-an-extension-module

----------
messages: 309266
nosy: brett.cannon, eric.snow, ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: Capsule API usage docs are incompatible with module reloading (etc)
type: behavior

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32459>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to