Re: Please review the new docs for #1440

2020-01-14 Thread Edward K. Ream
On Tue, Jan 14, 2020 at 6:10 PM Brian Theado wrote: > One thing I really like about the front page of that project ( https://github.com/gristlabs/asttokens) is the front-and-center example which shows in a few lines of code how to call the code using concrete inputs and shows exactly what the

Re: Discuss: a proposed answer to python issue #33337

2020-01-14 Thread Edward K. Ream
On Tue, Jan 14, 2020 at 8:00 PM Matt Wilkie wrote: > you've worked incredibly hard to this point, and it must be really exciting/enticing to be near a point of release and of shouting "hear ye, hear ye" loud enough to attract attention, but don't make noise just yet! I agree that more work is

Re: Discuss: a proposed answer to python issue #33337

2020-01-14 Thread Edward K. Ream
> Thanks for this suggestion. Imo, the demo is the TOG class compared with >> similar code in asttokens, fstringify and black. The differences are >> striking. >> > > This puts the burden on all the readers to go look at the two versions of > fstringify (and other) code and be able to figure out

Re: Please review the new docs for #1440

2020-01-14 Thread Brian Theado
I like your second comment . It is well written and informative. Nice job. You stress "token order traversal". How does that contrast the traversal provided by the ast library? Does your library still traverse the ast

Re: Discuss: a proposed answer to python issue #33337

2020-01-14 Thread Matt Wilkie
> > Here is the first draft of a reply to Python issue #7 > . This long-dormant issue discusses > possible improvements to python tools. > > I would appreciate it if you would read the thread in detail, and let me > know if the following reply seems on

Re: Please review the new docs for #1440

2020-01-14 Thread Brian Theado
In the theory of operation: "The notion of a *token order traversal* of a parse tree is the foundation of this project" In contrast, what traversal order do parse trees provide? How is token order different/better? What does it allow me to do that I can't otherwise do with parse trees? "This

Re: Discuss: a proposed answer to python issue #33337

2020-01-14 Thread Brian Theado
On Tue, Jan 14, 2020 at 4:05 PM Edward K. Ream wrote: > On Tue, Jan 14, 2020 at 3:00 PM Terry Brown wrote: > >> I wonder if a couple of demos would help, >> > > Thanks for this suggestion. Imo, the demo is the TOG class compared with > similar code in asttokens, fstringify and black. The

Re: Please review the new docs for #1440

2020-01-14 Thread Brian Theado
Ok, now I see in your proposed email response in the other thread you do mention the asttokens project. And also later in #1440 you said "The asttokens project assigns tokens to ast nodes, but only for statement-level ast nodes." That's useful to know.

Re: Please review the new docs for #1440

2020-01-14 Thread Brian Theado
I just followed the stackoverflow link ( https://stackoverflow.com/questions/16748029/how-to-get-source-corresponding-to-a-python-ast-node#) and someone posted that they created https://github.com/gristlabs/asttokens which "Annotates Python AST trees with source text and token information". Is

Re: Discuss: a proposed answer to python issue #33337

2020-01-14 Thread Edward K. Ream
On Tue, Jan 14, 2020 at 3:00 PM Terry Brown wrote: > I wonder if a couple of demos would help, > Thanks for this suggestion. Imo, the demo is the TOG class compared with similar code in asttokens, fstringify and black. The differences are striking. Edward -- You received this message

Re: Discuss: a proposed answer to python issue #33337

2020-01-14 Thread Terry Brown
I wonder if a couple of demos would help, "see how much better this is" rather than "ask me about how much better this is". Maybe a comparison like: https://gist.github.com/kennethreitz/973705 which compares `urllib2` to `requests` code to do the same thing. And perhaps some context like "I want

Discuss: a proposed answer to python issue #33337

2020-01-14 Thread Edward K. Ream
Here is the first draft of a reply to Python issue #7 . This long-dormant issue discusses possible improvements to python tools. I would appreciate it if you would read the thread in detail, and let me know if the following reply seems on topic and

Please review the new docs for #1440

2020-01-14 Thread Edward K. Ream
In a day or three I'll be announcing #1440 , the unification of parse trees and tokens, to python's core developers. I'll do that by making a comment in this related python issue . In preparation for