pyyaml
pyyaml copied to clipboard
Set Cython compiler directive language_level=3
Set language_level
to Python3 explicitly.
language_level – The source language level to use: 2 or 3. The default is to use the language level of the current Python runtime for .py files and Py2 for .pyx files.
Closes #409.
I was worried about the potential effects this change might have on the string/buffer handling stuff, especially now better understanding the nasty macro hacks that occurred to make the extension work under python 3.x back in the day... I'm glad to see that it at least passes all the tests, so I'm 50/50 whether we try to include this change in 6.0b2 (eg) or hold it for a little longer.
I assumed this would follow naturally after a31a4fb1894c49bad0bf43b942650fb521423bae.
Though also I opened PR #539 months ago in hopes of silencing the warning until then, so I can stop carrying ignores for it downstream when running with PYTHONWARNINGS=error on interpreter versions which are too new to have prebuilt wheels available (then Python 3.10 prereleases, now 3.11). Either solution works for me, but clarifying that it's using language level 2 until 2.7 support is dropped would at least take care of the warning in the meantime.