Skip to content

gh-116991: Improve pygen --help for python subparser #116992

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 3, 2024

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Mar 19, 2024

Copy link

@vasily-v-ryabov vasily-v-ryabov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for improving it and for the help! I personally started from CPython repository which contains folder Grammar with only python.gram. It would be nice to have python_in_c.gram and python_in_python.gram which makes the picture clear from the very beginning. But this is only my path. Maybe other paths could be improved as well. I didn't see it is well highlighted in Dev Guide.

Copy link
Member

@lysnikolaou lysnikolaou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@vasily-v-ryabov vasily-v-ryabov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

"python",
help=(
"Generate Python code, needs grammar definition with Python actions, "
"see `we-like-parsers/pegen`, start with `data/python.gram`"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should mention that repo. The input for the parser can be any grammar other than the general Python one. We use to generate the meta parser for example. I think linking to another repo it's actually more confusing.

This is also an internal tool without external user guarantees.

I would be on improving the help to mention a bit of this but I still prefer not to link against the original repo

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, how about this?

@sobolevn sobolevn merged commit 1e5f615 into python:main Jun 3, 2024
@sobolevn
Copy link
Member Author

sobolevn commented Jun 3, 2024

I've merged a simple version of --help update, without the link to the external repo.
Thanks everyone!

mliezun pushed a commit to mliezun/cpython that referenced this pull request Jun 3, 2024
barneygale pushed a commit to barneygale/cpython that referenced this pull request Jun 5, 2024
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request Jul 11, 2024
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants