[issue44386] importlib and math.pi interact strangely

2021-06-13 Thread Ned Deily
Change by Ned Deily : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs

[issue44386] importlib and math.pi interact strangely

2021-06-10 Thread Jack DeVries
Jack DeVries added the comment: That is because pi, along with other constants in the math module are defined during module execution, not module creation: https://github.com/python/cpython/blob/62f1d2b3d7dda99598d053e10b785c463fdcf591/Modules/cmathmodule.c#L1257-L1262 Taking the example rig

[issue44386] importlib and math.pi interact strangely

2021-06-10 Thread Paul Prescod
New submission from Paul Prescod : from importlib import util mathmodule = util.find_spec("math") math1 = util.module_from_spec(mathmodule) print(math1.pi) = $ python3.8 /tmp/foo.py 3.141592653589793 $ python3.9 /tmp/foo.py Traceback (most recent call last): File "/tmp/foo.py", line