Re: ast.parse, ast.dump, but with comment preservation?

2022-01-12 Thread samue...@gmail.com
> > PS: Library is https://github.com/SamuelMarks/cdd-python (might relicense > > with CC0… anyway too early for others to use; wait for the 0.1.0 release ;]) Ended up writing my own CST and added it to that library of mine (link above). My target is adding/removing/changing of: docstrings, funct

Re: ast.parse, ast.dump, but with comment preservation?

2022-01-12 Thread samue...@gmail.com
On Thursday, December 16, 2021 at 5:56:51 AM UTC-5, lucas wrote: > Hi ! > > Maybe RedBaron may help you ? > > https://github.com/PyCQA/redbaron > > IIRC, it aims to conserve the exact same representation of the source > code, including comments and empty lines. > > --lucas > On 16/12/2021

Re: ast.parse, ast.dump, but with comment preservation?

2021-12-16 Thread lucas
Hi ! Maybe RedBaron may help you ? https://github.com/PyCQA/redbaron IIRC, it aims to conserve the exact same representation of the source code, including comments and empty lines. --lucas On 16/12/2021 04:37, samue...@gmail.com wrote: I wrote a little open-source tool to expose internal

Re: ast.parse, ast.dump, but with comment preservation?

2021-12-16 Thread Barry
> On 16 Dec 2021, at 03:49, samue...@gmail.com wrote: > > I wrote a little open-source tool to expose internal constructs in OpenAPI. > Along the way, I added related functionality to: > - Generate/update a function prototype to/from a class > - JSON schema > - Automatically add type annotati

Re: ast.parse, ast.dump, but with comment preservation?

2021-12-15 Thread Chris Angelico
On Thu, Dec 16, 2021 at 2:47 PM samue...@gmail.com wrote: > > I wrote a little open-source tool to expose internal constructs in OpenAPI. > Along the way, I added related functionality to: > - Generate/update a function prototype to/from a class > - JSON schema > - Automatically add type annotati

ast.parse, ast.dump, but with comment preservation?

2021-12-15 Thread samue...@gmail.com
I wrote a little open-source tool to expose internal constructs in OpenAPI. Along the way, I added related functionality to: - Generate/update a function prototype to/from a class - JSON schema - Automatically add type annotations to all function arguments, class attributes, declarations, and ass

Re: ast.parse

2012-04-09 Thread Kiuhnm
On 4/9/2012 14:43, Irmen de Jong wrote: On 9-4-2012 13:53, Kiuhnm wrote: Is it a known fact that ast.parse doesn't handle line continuations and some multi-line expressions? For instance, he doesn't like for (x, y) in each([1, 2]): print

Re: ast.parse

2012-04-09 Thread Irmen de Jong
On 9-4-2012 13:53, Kiuhnm wrote: > Is it a known fact that ast.parse doesn't handle line continuations and some > multi-line > expressions? > For instance, he doesn't like > for (x, > y) in each([1, > 2]): > print(1)

Re: ast.parse

2012-04-09 Thread Chris Rebert
On Mon, Apr 9, 2012 at 4:53 AM, Kiuhnm wrote: > Is it a known fact that ast.parse doesn't handle line continuations and some > multi-line expressions? > For instance, he doesn't like >    for (x, >         y) in each([1, >                     2]): >        

ast.parse

2012-04-09 Thread Kiuhnm
Is it a known fact that ast.parse doesn't handle line continuations and some multi-line expressions? For instance, he doesn't like for (x, y) in each([1, 2]): print(1) at all. Is there a workaround besides "repairing" the code on the