8000 gh-85283: Build _statistics extension with the limited C API · python/cpython@cf0beee · GitHub
[go: up one dir, main page]

Skip to content

Commit cf0beee

Browse files
committed
gh-85283: Build _statistics extension with the limited C API
Argument Clinic now inlines _PyArg_CheckPositional() for the limited C API. The generated code should be as fast or even a little bit faster.
1 parent b8d808d commit cf0beee

File tree

2 files changed

+17
-35
lines changed

2 files changed

+17
-35
lines changed

Modules/_statisticsmodule.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/* statistics accelerator C extension: _statistics module. */
22

3-
// clinic/_statisticsmodule.c.h uses internal pycore_modsupport.h API
4-
#ifndef Py_BUILD_CORE_BUILTIN
5-
# define Py_BUILD_CORE_MODULE 1
3+
// Need limited C API version 3.12 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED
4+
#include "pyconfig.h" // Py_GIL_DISABLED
5+
#ifndef Py_GIL_DISABLED
6+
# define Py_LIMITED_API 0x030c0000
67
#endif
78

89
#include "Python.h"

Modules/clinic/_statisticsmodule.c.h

Lines changed: 13 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
0