◐ Shell
clean mode source ↗

bpo-40939: Rename PyPegen* functions to PyParser* by lysnikolaou · Pull Request #21016 · python/cpython

Conversation

@lysnikolaou

Renaame PyPegen* functions to PyParser*, so that we can remove the
old set of PyParser* functions that were using the old parser, but keep
everything backwards-compatible.

https://bugs.python.org/issue40939

Renaame PyPegen* functions to PyParser*, so that we can remove the
old set of PyParser* functions that were using the old parser.

@pablogsal

Seems that there some errors in Windows in Azure

@pablogsal

The windows build still fails, not sure where the errors are coming from :(

@lysnikolaou

Yeah, me neither. I'm gonna continue investigating, but if someone from the @python/windows-team could enlighten us, it'd be helpful.

@lysnikolaou

I guess the failure is unrelated to the changes of this PR. It probably has something to do with the Azure environment, since the exact same build target succeeds in the Windows Github Action, but fails with multiple compile errors on Azure.

@pablogsal

I guess the failure is unrelated to the changes of this PR. It probably has something to do with the Azure environment, since the exact same build target succeeds in the Windows Github Action, but fails with multiple compile errors on Azure.

But then why other PRs do not have the same problem?

@lysnikolaou

But then why other PRs do not have the same problem?

Unfortunately, I don't know. Will investigate more tomorrow.

@nnemkin

The reason for the breakage is that you're indirectly including Python-ast.h into Python.h (via pegen_interface.h).
Python-ast.h defines a lot of unprefixed names (historical mistake), like Yield or Set. It should never ever be included into Python.h (or any other header for that matter). Consider using struct _mod instead of mod_ty in header files.

@pablogsal

Consider using struct _mod instead of mod_ty in header files.

Or split the header file into a private version and a public one, which I think is cleaner

@lysnikolaou

It should never ever be included into Python.h (or any other header for that matter). Consider using struct _mod instead of mod_ty in header files.

And I was wondering why in pythonrun.h struct _mod * is used instead of mod_ty.

pablogsal

pablogsal

fasih pushed a commit to fasih/cpython that referenced this pull request

Jun 29, 2020
Rename PyPegen* functions to PyParser*, so that we can remove the
old set of PyParser* functions that were using the old parser.