More information on Question about Code Generation

13 views
Skip to first unread message

Andrew Frances

unread,
Jul 28, 2021, 11:49:39 AM7/28/21
to montrealpython
Hi Montreal Python group:

Some more information. I think something along the lines of 2to3.py. I am starting to look at Lib2to3 which in turn references LibCST as a solution moving forward. Still I would appreciate feedback.

Cheers,
Andrew

Yannick Gingras

unread,
Aug 9, 2021, 5:24:46 PM8/9/21
to Andrew Frances, montrealpython

Hi Andrew,
I think AST would would be better than whatever lib2to3 is using.
Starting with Python 3.9, lib2to3 is pending deprecation as a result of
Python changing its parser. The 3.9 release notes recommend using ast,
which will be maintained to support the new syntax features moving
forward.

Good luck!
> --
> Vous recevez ce message, car vous êtes abonné au groupe
> Google Groupes
> "Montréal-Python".
> Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le
> concernant, envoyez un e-mail à l'adresse
> montrealpytho...@googlegroups.com.
> Cette discussion peut être lue sur le Web à l'adresse
> https://groups.google.com/d/msgid/montrealpython/CANYrJ%3DRH%2BpxNA5vL3CNxzTcmKDgSRfcb4D_5scHZ53_%2BjJ4Ctw%40mail.gmail.com
> .

--
Yannick Gingras
http://ygingras.net

signature.asc

Andrew Frances

unread,
Aug 10, 2021, 11:01:03 AM8/10/21
to Yannick Gingras, montrealpython
Hi Yannick:

Great to hear from you. Thanks for your input! Yes, the parser changed in Python 3.9. I ended up going with LibCST. LibCST is up to date, good documentation and it worked like a charm! If I get more work done (I'm writing tools for a Python based voice app), perhaps I can give a talk when MTL Python resumes in person.

Again, thanks for your input!

Cheers,
Andrew

Yannick Gingras

unread,
Aug 10, 2021, 11:44:12 AM8/10/21
to Andrew Frances, montrealpython

Great to know that LibCST is a viable option. By the way, you don't
have to wait until meetings resume in person since we have an excellent
series of virtual meetings since the start of the Pandemic:
https://www.meetup.com/Montreal-Python/events/
signature.asc
Reply all
Reply to author
Forward
0 new messages