Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 921eb8e

Browse filesBrowse files
authored
gh-106320: Remove private _PyLong_New() function (#108604)
Move the following private API to the internal C API (pycore_long.h): * _PyLong_Copy() * _PyLong_FromDigits() * _PyLong_New() No longer export most of these functions.
1 parent 21a7420 commit 921eb8e
Copy full SHA for 921eb8e

File tree

Expand file treeCollapse file tree

2 files changed

+11
-8
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+11
-8
lines changed
Open diff view settings
Collapse file

‎Include/cpython/longintrepr.h‎

Copy file name to clipboardExpand all lines: Include/cpython/longintrepr.h
-8Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,6 @@ struct _longobject {
8989
_PyLongValue long_value;
9090
};
9191

92-
PyAPI_FUNC(PyLongObject *) _PyLong_New(Py_ssize_t);
93-
94-
/* Return a copy of src. */
95-
PyAPI_FUNC(PyObject *) _PyLong_Copy(PyLongObject *src);
96-
97-
PyAPI_FUNC(PyLongObject *)
98-
_PyLong_FromDigits(int negative, Py_ssize_t digit_count, digit *digits);
99-
10092

10193
/* Inline some internals for speed. These should be in pycore_long.h
10294
* if user code didn't need them inlined. */
Collapse file

‎Include/internal/pycore_long.h‎

Copy file name to clipboardExpand all lines: Include/internal/pycore_long.h
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,17 @@ extern "C" {
4747
# error "_PY_LONG_DEFAULT_MAX_STR_DIGITS smaller than threshold."
4848
#endif
4949

50+
extern PyLongObject* _PyLong_New(Py_ssize_t);
51+
52+
// Return a copy of src.
53+
extern PyObject* _PyLong_Copy(PyLongObject *src);
54+
55+
// Export for '_decimal' shared extension
56+
PyAPI_FUNC(PyLongObject*) _PyLong_FromDigits(
57+
int negative,
58+
Py_ssize_t digit_count,
59+
digit *digits);
60+
5061

5162
/* runtime lifecycle */
5263

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.