#libcst — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #libcst, aggregated by home.social.
-
Just rewriting #jinja python code generator to #libCST . So far it takes more code to do the same but it's much simpler to do the hard stuff, especially when there's a lot of conditionals.
Take annotated class field: can be generic or not, can have annotated metadata or not. Annotated metadata may be name (class or function), generic or not, or a call, and so on.
A big nuisance of libCST is indentation - it belongs to the previous node, even though we tend to think as part of the next one. For an indented language it's rather weird design decision.
#JSONSchema #codeGenerator #programming #python #pythonLapidary
-
Just rewriting #jinja python code generator to #libCST . So far it takes more code to do the same but it's much simpler to do the hard stuff, especially when there's a lot of conditionals.
Take annotated class field: can be generic or not, can have annotated metadata or not. Annotated metadata may be name (class or function), generic or not, or a call, and so on.
A big nuisance of libCST is indentation - it belongs to the previous node, even though we tend to think as part of the next one. For an indented language it's rather weird design decision.
#JSONSchema #codeGenerator #programming #python #pythonLapidary
-
Listening to the latest @pythonbytes episode and damn, hearing that @brianokken hadn't heard of #LibCST makes me think I should have brought that along for my own guest appearance in that show after all 😅
I didn't because the topic search said it had been covered in episode 179 by Guido himself 😬
Have found it quite helpful though to write some custom checks and mods to use with precommit on #OctoPrint, has made some cleanup a LOT faster together with #pyupgrade.