FYI: Leo will not support leoAst.py beyond Python 3.14

24 views
Skip to first unread message

Edward K. Ream

unread,
Aug 2, 2025, 7:20:07 AMAug 2
to leo-editor
PR #4404 (in progress) makes all changes needed to support Python 3.14, due in October.

This PR includes changes to leoAst.py needed to support Python's new template strings

Maintaining leoAst.py has always been difficult and thankless. Leo does not use this module, and neither have I. Yes, the concept is kinda nifty, but the code has little real-world value. For most purposes, asttokens is a better choice.

Summary

It's time to say "enough". The PR supports leoAst.py so that it works with Python 3.14. There is no reason to support leoAst.py so that it works with Python 3.15 or beyond.

The PR announces (in the code and docs) that support for leoAst.py will not extend past Python 3.14.

The code in leoAst.py has always been a curiosity. There is no reason to burden Leo's devs with it. Don't ask me to reconsider this decision unless you are prepared to support this code for the next five years.

Edward

Edward K. Ream

unread,
Aug 2, 2025, 11:56:29 AMAug 2
to leo-editor
On Saturday, August 2, 2025 at 6:20:07 AM UTC-5 Edward K. Ream wrote:

> PR #4404 (in progress)...supports leoAst.py so that it works with Python 3.14. There is no reason to support leoAst.py so that it works with Python 3.15 or beyond.

Here are some more notes:

- The release notes for Leo 6.8.7 will announce that leoAst.py is deprecated. If nobody uses leoAst.py, that may be the only change ever needed!

- The What's new with Python 3.15 page does not (for the moment) list any changes that affect Python's ast module. So leoAst.py might continue to work through Python 3.15. There is no similar page for Python 3.16, so that's all I can say now.

- I plan to leave Leo's unit tests as they are. The first sign that leoAst.py needs work will likely be the failure of the test TestTokens.test_visitors_exist. Future maintainers can then decide whether to retire leoAst.py.

Summary

My plan is to make minimal changes and wait and see what to do next.

Edward
Reply all
Reply to author
Forward
0 new messages