Is it possible to use language level 2 with python 3.12?
13 views
Skip to first unread message
Idan Ahal
unread,
Aug 4, 2025, 1:28:16 PMAug 4
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cython-users
Is setting #cython: language_level = 2 still compatible with the latest Cython and Python 3.12?
I couldn't find an answer on the web and would be happy for some clarification.
Oscar Benjamin
unread,
Aug 4, 2025, 4:00:26 PMAug 4
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cython...@googlegroups.com
Have you tried it?
If you have some existing code that needs language level 2 then just
try it. If you don't have such existing code then I recommend setting
language_level = 3.
--
Oscar
Idan Ahal
unread,
Aug 5, 2025, 10:55:56 PMAug 5
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cython-users
I'm scarred of not edge cases like missing micros for example.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cython...@googlegroups.com
I'm not sure what a "missing micro" is.
However, language_level=2 does still work. The one thing you'll find is that `"abc"` is a Py3 string rather than bytes. So it isn't a perfect Python 2 emulator.
For new code, I'm not sure why you'd choose to use language_level=2 though