Skip to content

Conversation

@lysnikolaou
Copy link
Member

@lysnikolaou lysnikolaou commented May 1, 2020

This PR tries to make both APIs more consistent by doing the following:

  • Remove the PyPegen_CodeObjectFrom* functions, which weren't used
    and will probably not be needed. Functions like
    Py_CompileStringObject can be used instead.
  • Include a const char *filename parameter in PyPegen_ASTFromString.
  • Rename PyPegen_ASTFromFile to PyPegen_ASTFromFilename, because
    its signature is not the same with PyParser_ASTFromFile.

Closes we-like-parsers#104.

https://bugs.python.org/issue40334

This PR tries to make both APIs more consistent by doing the following:
- Remove the `PyPegen_CodeObjectFrom*` functions, which weren't used
  and will probably not be needed. Functions like
  `Py_CompileStringObject` can be used instead.
- Include a `const char *filename` parameter in `PyPegen_ASTFromString`.
- Rename `PyPegen_ASTFromFile` to `PyPegen_ASTFromFilename`, because
  its signature is not the same with `PyParser_ASTFromFile`.

Closes #we-like-parsers#104.
@pablogsal
Copy link
Member

+37 −111

Exquisite 👌

@lysnikolaou
Copy link
Member Author

+37 −111

Exquisite 👌

And that's with rewriting all the arguments to appear one per line in pegen_interface.h! 😄

@pablogsal pablogsal merged commit 03b7642 into python:master May 1, 2020
@pablogsal
Copy link
Member

@lysnikolaou Thanks also for adding good commit messages: it makes writing the final commit message much easier :)

@lysnikolaou lysnikolaou deleted the api-consistency branch May 1, 2020 17:50
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.

Add 'char *filename' arg to PyParser_ASTFromString()

4 participants