GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||
GeezerVison is showing github.com — gh-92651: Remove the Include/token.h header file by vstinner · Pull Request #92652 · python/cpython Conversation
|
|
@pablogsal @lysnikolaou @iritkatriel: Do you see any reason to expose token.h as part of the public C API? Or are you fine with removing this header file from the public C API? Issue: #92651 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Remove the token.h header file. There was never any public tokenizer C API. The token.h header file was only designed to be used by Python internals. Move Include/token.h to Include/internal/pycore_token.h. Including this header file now requires that the Py_BUILD_CORE macro is defined. It no longer checks for the Py_LIMITED_API macro. Rename functions: * PyToken_OneChar() => _PyToken_OneChar() * PyToken_TwoChars() => _PyToken_TwoChars() * PyToken_ThreeChars() => _PyToken_ThreeChars()
I tried to no longer export these symbols, but it broke test_peg_generator. I reverted this change. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Update also the default value in make_h().
Should PyAPI_FUNC and PyAPI_DATA be used in declarations?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Oh right, I updated my PR.
As I wrote in my previous comment, first, I removed PyAPI_FUNC() and PyAPI_DATA() but it broke test_peg_generator. This test builds C extensions which are linked dynamically. I added |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
No, and is a bad idea to have it as part of the public C API, so if we can move it to the internal heafers folder, that would be great :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This PR doesn't respect PEP 387 deprecation process because:
In Python 3.10, Parser/tokenizer.h defines these functions: Python is now built with In Python 3.11, these functions were renamed to get a "_Py" prefix. For example, PyTokenizer_FromString() was renamed to _PyTokenizer_FromString(). These functions are not exported and are private since Python 3.11 ( |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Merged. Thanks for the reviews! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.