FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-107211: No longer export internal functions (1) by vstinner · Pull Request #107213 · python/cpython · GitHub

Repository navigation

gh-107211: No longer export internal functions (1) - #107213

Merged
vstinner merged 1 commit into
python:mainfrom
vstinner:extern1
Jul 25, 2023
Merged

vstinner merged 1 commit into
python:mainfrom
vstinner:extern1

Conversation

vstinner commented Jul 25, 2023 •
edited
Loading

Copy link
Copy Markdown
Member

No longer export these 52 internal functions:

  • _PyArgv_AsWstrList()
  • _PyCode_New()
  • _PyCode_Validate()
  • _PyFloat_DebugMallocStats()
  • _PyFloat_FormatAdvancedWriter()
  • _PyImport_CheckSubinterpIncompatibleExtensionAllowed()
  • _PyImport_ClearExtension()
  • _PyImport_GetModuleId()
  • _PyImport_SetModuleString()
  • _PyInterpreterState_IDDecref()
  • _PyInterpreterState_IDIncref()
  • _PyInterpreterState_IDInitref()
  • _PyInterpreterState_LookUpID()
  • _PyWideStringList_AsList()
  • _PyWideStringList_CheckConsistency()
  • _PyWideStringList_Clear()
  • _PyWideStringList_Copy()
  • _PyWideStringList_Extend()
  • _Py_ClearArgcArgv()
  • _Py_DecodeUTF8Ex()
  • _Py_DecodeUTF8_surrogateescape()
  • _Py_EncodeLocaleRaw()
  • _Py_EncodeUTF8Ex()
  • _Py_GetEnv()
  • _Py_GetForceASCII()
  • _Py_GetLocaleEncoding()
  • _Py_GetLocaleEncodingObject()
  • _Py_GetLocaleconvNumeric()
  • _Py_ResetForceASCII()
  • _Py_closerange()
  • _Py_device_encoding()
  • _Py_dg_dtoa()
  • _Py_dg_freedtoa()
  • _Py_dg_strtod()
  • _Py_get_blocking()
  • _Py_get_env_flag()
  • _Py_get_inheritable()
  • _Py_get_osfhandle()
  • _Py_get_osfhandle_noraise()
  • _Py_get_xoption()
  • _Py_open()
  • _Py_open_osfhandle()
  • _Py_open_osfhandle_noraise()
  • _Py_read()
  • _Py_set_blocking()
  • _Py_stat()
  • _Py_str_to_int()
  • _Py_wfopen()
  • _Py_wgetcwd()
  • _Py_wreadlink()
  • _Py_wrealpath()
  • _Py_write()

No longer export these 49 internal C API functions:

* _PyArgv_AsWstrList()
* _PyCode_New()
* _PyCode_Validate()
* _PyFloat_DebugMallocStats()
* _PyFloat_FormatAdvancedWriter()
* _PyImport_CheckSubinterpIncompatibleExtensionAllowed()
* _PyImport_ClearExtension()
* _PyImport_GetModuleId()
* _PyImport_SetModuleString()
* _PyInterpreterState_IDDecref()
* _PyInterpreterState_IDIncref()
* _PyInterpreterState_IDInitref()
* _PyInterpreterState_LookUpID()
* _PyWideStringList_AsList()
* _PyWideStringList_CheckConsistency()
* _PyWideStringList_Clear()
* _PyWideStringList_Copy()
* _PyWideStringList_Extend()
* _Py_ClearArgcArgv()
* _Py_DecodeUTF8Ex()
* _Py_DecodeUTF8_surrogateescape()
* _Py_EncodeLocaleRaw()
* _Py_EncodeUTF8Ex()
* _Py_GetEnv()
* _Py_GetForceASCII()
* _Py_GetLocaleEncoding()
* _Py_GetLocaleEncodingObject()
* _Py_GetLocaleconvNumeric()
* _Py_ResetForceASCII()
* _Py_device_encoding()
* _Py_dg_dtoa()
* _Py_dg_freedtoa()
* _Py_dg_strtod()
* _Py_get_blocking()
* _Py_get_env_flag()
* _Py_get_inheritable()
* _Py_get_osfhandle_noraise()
* _Py_get_xoption()
* _Py_open()
* _Py_open_osfhandle()
* _Py_open_osfhandle_noraise()
* _Py_read()
* _Py_set_blocking()
* _Py_str_to_int()
* _Py_wfopen()
* _Py_wgetcwd()
* _Py_wreadlink()
* _Py_wrealpath()
* _Py_write()

Copy link
Copy Markdown
Member

_PyImport_GetModuleId()

Isn't this for _Py_IDENTIFIER()? What's using it?

_PyInterpreterState_IDDecref()
_PyInterpreterState_IDIncref()
_PyInterpreterState_IDInitref()
_PyInterpreterState_LookUpID()

Aren't these used by _xxsubinterpreters?

Copy link
Copy Markdown
Member Author

_PyImport_GetModuleId()
Isn't this for _Py_IDENTIFIER()? What's using it?

It seems like nobody uses _PyImport_GetModuleId(). Maybe it can just be removed.

A code search on _PyImport_GetModuleId regex on PyPI top 5,000 projects found no user of this function.

_PyInterpreterState_IDDecref()
_PyInterpreterState_IDIncref()
_PyInterpreterState_IDInitref()
_PyInterpreterState_LookUpID()

Aren't these used by _xxsubinterpreters?

These functions are only used by Objects/interpreteridobject.c and Python/pystate.c. These functions are not used by shared extensions, so there is no need to export them.

What I can say is that tests pass on all platforms :-) So _xxsubinterpreters looks fine.

vstinner merged commit 11306a9 into python:main Jul 25, 2023
vstinner deleted the extern1 branch July 25, 2023 01:44
jtcave pushed a commit to jtcave/cpython that referenced this pull request Jul 27, 2023
No longer export these 49 internal C API functions:

* _PyArgv_AsWstrList()
* _PyCode_New()
* _PyCode_Validate()
* _PyFloat_DebugMallocStats()
* _PyFloat_FormatAdvancedWriter()
* _PyImport_CheckSubinterpIncompatibleExtensionAllowed()
* _PyImport_ClearExtension()
* _PyImport_GetModuleId()
* _PyImport_SetModuleString()
* _PyInterpreterState_IDDecref()
* _PyInterpreterState_IDIncref()
* _PyInterpreterState_IDInitref()
* _PyInterpreterState_LookUpID()
* _PyWideStringList_AsList()
* _PyWideStringList_CheckConsistency()
* _PyWideStringList_Clear()
* _PyWideStringList_Copy()
* _PyWideStringList_Extend()
* _Py_ClearArgcArgv()
* _Py_DecodeUTF8Ex()
* _Py_DecodeUTF8_surrogateescape()
* _Py_EncodeLocaleRaw()
* _Py_EncodeUTF8Ex()
* _Py_GetEnv()
* _Py_GetForceASCII()
* _Py_GetLocaleEncoding()
* _Py_GetLocaleEncodingObject()
* _Py_GetLocaleconvNumeric()
* _Py_ResetForceASCII()
* _Py_device_encoding()
* _Py_dg_dtoa()
* _Py_dg_freedtoa()
* _Py_dg_strtod()
* _Py_get_blocking()
* _Py_get_env_flag()
* _Py_get_inheritable()
* _Py_get_osfhandle_noraise()
* _Py_get_xoption()
* _Py_open()
* _Py_open_osfhandle()
* _Py_open_osfhandle_noraise()
* _Py_read()
* _Py_set_blocking()
* _Py_str_to_int()
* _Py_wfopen()
* _Py_wgetcwd()
* _Py_wreadlink()
* _Py_wrealpath()
* _Py_write()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants


Back | FazBrowse Home | New Git URL