bpo-45434: Mark the PyTokenizer C API as private#28924
Conversation
Rename PyTokenize functions to mark them as private: * PyTokenizer_FindEncodingFilename() => _PyTokenizer_FindEncodingFilename() * PyTokenizer_FromString() => _PyTokenizer_FromString() * PyTokenizer_FromFile() => _PyTokenizer_FromFile() * PyTokenizer_FromUTF8() => _PyTokenizer_FromUTF8() * PyTokenizer_Free() => _PyTokenizer_Free() * PyTokenizer_Get() => _PyTokenizer_Get() Remove the unused PyTokenizer_FindEncoding() function. import.c: remove unused #include "errcode.h".
|
@pablogsal @isidentical @lysnikolaou: Do you see any reason to keep the PyTokenizer as public? My plan is to move E_xxx constants from Include/errcode.h to Include/internal/pycore_parser.h, and then remove the Include/errcode.h header filer. |
Sorry, something went wrong.
I don't see any reason for external apps to depend on these methods, especially when we already have a pure Python version. |
Sorry, something went wrong.
In fact, it's not possible without breaking the backward compatibility: https://bugs.python.org/issue45434#msg403841 |
Sorry, something went wrong.
|
But marking the tokenizer C API as private is still worth it ;-) |
Sorry, something went wrong.
Rename PyTokenize functions to mark them as private:
Remove the unused PyTokenizer_FindEncoding() function.
import.c: remove unused #include "errcode.h".
https://bugs.python.org/issue45434