◐ Shell
clean mode source ↗

bpo-40334: Make the PyPegen* and PyParser* APIs more consistent by lysnikolaou · Pull Request #19839 · python/cpython

@lysnikolaou

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.