On 2017-11-23, Lawrence D’Oliveiro <lawrenced...@gmail.com> 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
> <https://docs.python.org/3/extending/extending.html#calling-python-functions-from-c>
> example uses a global variable.

Says Benjamin Peterson on docs.python.org:

https://docs.python.org/3/howto/cporting.html

    "Python 3 has a revamped extension module initialization system.
    (See PEP 3121.) Instead of storing module state in globals, they
    should be stored in an interpreter specific structure. Creating
    modules that act correctly in both Python 2 and Python 3 is
    tricky."

He's not kidding, not least because it appears that creating modules
that act correctly in Python 3 at all is tricky!
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to