You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running under Python 3, any .py file that pyximport is triggered for can be expected to be in Python 3 syntax. Currently, pyximporting simply fails because of syntax errors because it does not configure the language level at all. Therefore, pyximport's import hook should automatically switch to -3 mode under Python 3 when compiling a .py file.
Note that the same is not true for .pyx files, which may or may not in Py3 syntax. So there should additionally be a way to configure the language level explicitly when installing the pyximport import hooks.
Unless I'm doing something wrong, as of 0.29.7 this is still not implemented at least when using pyximport. If you do not specify the language_level manually it gives you the FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! even though it should know it's using Python 3.x.
When running under Python 3, any .py file that pyximport is triggered for can be expected to be in Python 3 syntax. Currently, pyximporting simply fails because of syntax errors because it does not configure the language level at all. Therefore, pyximport's import hook should automatically switch to -3 mode under Python 3 when compiling a .py file.
Note that the same is not true for .pyx files, which may or may not in Py3 syntax. So there should additionally be a way to configure the language level explicitly when installing the pyximport import hooks.
Migrated from http://trac.cython.org/ticket/733
The text was updated successfully, but these errors were encountered: