Re: Finding the module object in Python 3 C extensions (Posting On Python-List Prohibited)

2017-11-23 Thread Jon Ribbens
On 2017-11-23, Lawrence D’Oliveiro wrote: > On Thursday, November 23, 2017 at 4:03:18 AM UTC+13, Jon Ribbens wrote: >> In Python 3, you are supposed to store the global state in an >> allocated memory area instead. > > Says who? Considering that this >

Finding the module object in Python 3 C extensions

2017-11-22 Thread Jon Ribbens
In Python 2, a C extension module's global state was stored in global variables. This obviously means the state is trivially accessible to all code in the module. In Python 3, you are supposed to store the global state in an allocated memory area instead. For functions defined directly under the