[LyX/ next] Prepare the removal of Python 2 support

José Matos jaomatos at gmail.com
Fri May 31 20:13:40 UTC 2024


On Thu, 2024-05-30 at 12:33 -0400, Richard Kimberly Heck wrote:
> This does look powerful. But it's unclear to me whether it's worth 
> requiring. I don't have a strong view.
> 
> Riki

FWIW worth the choice of 3.10 is not arbitrary on my part.

A new Python parser was introduced in Python 3.9:

A new parser for CPython
https://lwn.net/Articles/816922/

The implementation of this parser allowed for constructions that would
be otherwise not possible:

An overview of structural pattern matching for Python
https://lwn.net/Articles/893193/

Or even removing the sub-parser used for formatted strings:

Formalizing f-strings
https://lwn.net/Articles/919426/


The bottom issue is that I can not use 3.10 code like match in a file
that will be parsed by a previous version.

The only option that I see is to place that code in another file/module
and import it conditionally in the first file. Not handy but there are
worse things in life. :-)
-- 
José Abílio


More information about the lyx-devel mailing list