GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-107211: No longer export internal functions (1) by vstinner · Pull Request #107213 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented Jul 25, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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()
  • Issue: C API: No longer export internal C API functions #107211

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vstinner
vstinner requested review from brettcannon, ericsnowcurrently, markshannon, ncoghlan and warsaw as code owners July 25, 2023 00:21
@bedevere-bot bedevere-bot mentioned this pull request Jul 25, 2023
C API: No longer export internal C API functions #107211
Closed
@bedevere-bot bedevere-bot added the awaiting core review label Jul 25, 2023
@vstinner vstinner added skip news topic-C-API and removed awaiting core review labels Jul 25, 2023
@vstinner
vstinner force-pushed the extern1 branch 2 times, most recently from 8b7c505 to f045079 Compare July 25, 2023 00:47
@vstinner
pythongh-107211: No longer export internal functions (1)
64e11f6
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()
@vstinner
vstinner force-pushed the extern1 branch from f045079 to 64e11f6 Compare July 25, 2023 01:02
@ericsnowcurrently

ericsnowcurrently commented Jul 25, 2023

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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Jul 25, 2023

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.

ericsnowcurrently reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner
vstinner merged commit 11306a9 into python:main Jul 25, 2023
@vstinner
vstinner deleted the extern1 branch July 25, 2023 01:44
@ericsnowcurrently ericsnowcurrently mentioned this pull request Jul 25, 2023
Remove unused internal _PyImport_GetModuleId() function #107235
Merged
jtcave pushed a commit to jtcave/cpython that referenced this pull request Jul 27, 2023
@vstinner @jtcave
pythongh-107211: No longer export internal functions (1) (python#107213)
b1cf5e6
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()
@skirpichev skirpichev mentioned this pull request Nov 28, 2024
_Py_wfopen no longer exported #127350
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@brettcannon brettcannon Awaiting requested review from brettcannon brettcannon is a code owner
@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently ericsnowcurrently is a code owner
@ncoghlan ncoghlan Awaiting requested review from ncoghlan ncoghlan is a code owner
@warsaw warsaw Awaiting requested review from warsaw warsaw is a code owner
@markshannon markshannon Awaiting requested review from markshannon markshannon is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news topic-C-API

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@vstinner @ericsnowcurrently @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.