You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now that we are in Beta3 and the release candidate is closer, we should start thinking about how we want to display the grammar in the documentation. Some initial discussion happened in the draft PR I opened here:
My thought is that we may be better off doing it by hand. :-(
Yeah, the more I think about it the more I agree. Is a bit sad unfortunately because the duplicate work and the danger of keeping it out of date (lately we updated some of the grammar blocks in the reference docs were out of date IIRC).
Maybe we can collect the grammar fragments from the rest of the reference docs?
If we do that we would be free of having to explain PEG and how to read the PEG grammar but then not sure if we can sell it as "the official grammar" in the sense that the resulting grammar would be "untested".
My gut feeling tells me that many of the people who would look at the grammar would likely want to reproduce it somehow or check some specific behaviour and for that it would be better to be as close as possible to the PEG one.
I think that people who want to reproduce exactly what we do should probably just read the source code of python.gram. What's more useful in the reference docs is probably something that qualifies as a complete grammar for users collected on one page. I recall that long ago when Pascal was my favorite language I couldn't afford the (only existing) Pascal book, but instead I had a photocopy of the grammar summary from an appendix of the book. I imagine there are still people who like that kind of thing.
Activity
gvanrossum commentedon Jun 12, 2020
My thought is that we may be better off doing it by hand. :-(
Maybe we can collect the grammar fragments from the rest of the reference docs?
pablogsal commentedon Jun 12, 2020
Yeah, the more I think about it the more I agree. Is a bit sad unfortunately because the duplicate work and the danger of keeping it out of date (lately we updated some of the grammar blocks in the reference docs were out of date IIRC).
If we do that we would be free of having to explain PEG and how to read the PEG grammar but then not sure if we can sell it as "the official grammar" in the sense that the resulting grammar would be "untested".
My gut feeling tells me that many of the people who would look at the grammar would likely want to reproduce it somehow or check some specific behaviour and for that it would be better to be as close as possible to the PEG one.
gvanrossum commentedon Jun 12, 2020
I think that people who want to reproduce exactly what we do should probably just read the source code of python.gram. What's more useful in the reference docs is probably something that qualifies as a complete grammar for users collected on one page. I recall that long ago when Pascal was my favorite language I couldn't afford the (only existing) Pascal book, but instead I had a photocopy of the grammar summary from an appendix of the book. I imagine there are still people who like that kind of thing.
gvanrossum commentedon Jul 25, 2020
Cross reference: https://bugs.python.org/issue40939
Delete remaining references to Grammar/Grammar
Delete remaining references to Grammar/Grammar from docs (#21624)
Delete remaining references to Grammar/Grammar from docs (python#21624)
Delete remaining references to Grammar/Grammar from docs (python#21624)
Delete remaining references to Grammar/Grammar from docs (python#21624)