pyyaml icon indicating copy to clipboard operation
pyyaml copied to clipboard

Set Cython compiler directive language_level=3

Open bsolomon1124 opened this issue 2 years ago • 3 comments

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.

bsolomon1124 avatar Oct 03 '21 00:10 bsolomon1124

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.

nitzmahone avatar Oct 04 '21 16:10 nitzmahone

I assumed this would follow naturally after a31a4fb1894c49bad0bf43b942650fb521423bae.

bsolomon1124 avatar Oct 04 '21 23:10 bsolomon1124

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.

fungi avatar Oct 07 '21 16:10 fungi