summaryrefslogtreecommitdiffstats
path: root/Include/Python.h
Commit message (Collapse)AuthorAgeFilesLines
* bpo-43244: Remove the pyarena.h header (GH-25007)Victor Stinner2021-03-241-1/+0
| | | | | | | | | | | | | | | | | | Remove the pyarena.h header file with functions: * PyArena_New() * PyArena_Free() * PyArena_Malloc() * PyArena_AddPyObject() These functions were undocumented, excluded from the limited C API, and were only used internally by the compiler. Add pycore_pyarena.h header. Rename functions: * PyArena_New() => _PyArena_New() * PyArena_Free() => _PyArena_Free() * PyArena_Malloc() => _PyArena_Malloc() * PyArena_AddPyObject() => _PyArena_AddPyObject()
* bpo-43244: Remove parser_interface.h header file (GH-25001)Victor Stinner2021-03-241-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Remove parser functions using the "struct _mod" type, because the AST C API was removed: * PyParser_ASTFromFile() * PyParser_ASTFromFileObject() * PyParser_ASTFromFilename() * PyParser_ASTFromString() * PyParser_ASTFromStringObject() These functions were undocumented and excluded from the limited C API. Add pycore_parser.h internal header file. Rename functions: * PyParser_ASTFromFileObject() => _PyParser_ASTFromFile() * PyParser_ASTFromStringObject() => _PyParser_ASTFromString() These functions are no longer exported (replace PyAPI_FUNC() with extern). Remove also _PyPegen_run_parser_from_file() function. Update test_peg_generator to use _PyPegen_run_parser_from_file_pointer() instead.
* bpo-35134: Move non-limited C API files to Include/cpython/ (GH-24561)Nicholas Sim2021-02-191-5/+5
| | | | | | Include/{odictobject.h,parser_interface.h,picklebufobject.h,pydebug.h,pyfpe.h} into Include/cpython/. Parser: peg_api: include Python.h instead of parser_interface.h.
* bpo-35134: Move Include/{pyarena.h,pyctype.h} to Include/cpython/ (GH-24550)Nicholas Sim2021-02-171-2/+2
| | | | Move non-limited C API headers pyarena.h and pyctype.h into Include/cpython/ directory.
* bpo-35134, Include: Move pytime.h to cpython/pytime.h (GH-23988)Nicholas Sim2021-02-161-1/+1
| | | | This change is backward compatible since C extension modules must not include "pytime.h" directly, but only include "Python.h".
* bpo-40939: Rename PyPegen* functions to PyParser* (GH-21016)Lysandros Nikolaou2020-06-211-0/+1
| | | | | | Rename PyPegen* functions to PyParser*, so that we can remove the old set of PyParser* functions that were using the old parser.
* bpo-40421: Add Include/cpython/code.h header file (GH-19756)Victor Stinner2020-04-281-0/+1
| | | | | | | | | | | bpo-35134, bpo-40421: Add Include/cpython/code.h header file. code.h now defines PyCodeObject type in the limited C API. It is now included by Python.h. Give a name to the PyCodeObject structure: it is now called "struct PyCodeObject". So it becomes possible to define PyCodeObject as "struct PyCodeObject" in the limited C API without defining the structure.
* bpo-40421: Add pyframe.h header file (GH-19755)Victor Stinner2020-04-281-0/+1
| | | | | | | | | | Add a new separated pyframe.h header file of the PyFrame public C API: it is included by Python.h. Add PyFrame_GetLineNumber() to the limited C API. Replace "struct _frame" with "PyFrameObject" in header files. PyFrameObject is now defined as struct _frame by pyframe.h which is included early enough in Python.h.
* bpo-40268: Remove explicit pythread.h includes (#19529)Victor Stinner2020-04-151-0/+1
| | | | Remove explicit pythread.h includes: it is always included by Python.h.
* bpo-39481: Implementation for PEP 585 (#18239)Guido van Rossum2020-04-071-0/+1
| | | | | | | | | | | | This implements things like `list[int]`, which returns an object of type `types.GenericAlias`. This object mostly acts as a proxy for `list`, but has attributes `__origin__` and `__args__` that allow recovering the parts (with values `list` and `(int,)`. There is also an approximate notion of type variables; e.g. `list[T]` has a `__parameters__` attribute equal to `(T,)`. Type variables are objects of type `typing.TypeVar`.
* bpo-35081: Move dtoa.h header to the internal C API (GH-18489)Victor Stinner2020-02-121-1/+0
| | | | | | | Move the dtoa.h header file to the internal C API as pycore_dtoa.h: it only contains private functions (prefixed by "_Py"). The math and cmath modules must now be compiled with the Py_BUILD_CORE macro defined.
* bpo-36763: Implement the PEP 587 (GH-13592)Victor Stinner2019-05-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add a whole new documentation page: "Python Initialization Configuration" * PyWideStringList_Append() return type is now PyStatus, instead of int * PyInterpreterState_New() now calls PyConfig_Clear() if PyConfig_InitPythonConfig() fails. * Rename files: * Python/coreconfig.c => Python/initconfig.c * Include/cpython/coreconfig.h => Include/cpython/initconfig.h * Include/internal/: pycore_coreconfig.h => pycore_initconfig.h * Rename structures * _PyCoreConfig => PyConfig * _PyPreConfig => PyPreConfig * _PyInitError => PyStatus * _PyWstrList => PyWideStringList * Rename PyConfig fields: * use_module_search_paths => module_search_paths_set * module_search_path_env => pythonpath_env * Rename PyStatus field: _func => func * PyInterpreterState: rename core_config field to config * Rename macros and functions: * _PyCoreConfig_SetArgv() => PyConfig_SetBytesArgv() * _PyCoreConfig_SetWideArgv() => PyConfig_SetArgv() * _PyCoreConfig_DecodeLocale() => PyConfig_SetBytesString() * _PyInitError_Failed() => PyStatus_Exception() * _Py_INIT_ERROR_TYPE_xxx enums => _PyStatus_TYPE_xxx * _Py_UnixMain() => Py_BytesMain() * _Py_ExitInitError() => Py_ExitStatusException() * _Py_PreInitializeFromArgs() => Py_PreInitializeFromBytesArgs() * _Py_PreInitializeFromWideArgs() => Py_PreInitializeFromArgs() * _Py_PreInitialize() => Py_PreInitialize() * _Py_RunMain() => Py_RunMain() * _Py_InitializeFromConfig() => Py_InitializeFromConfig() * _Py_INIT_XXX() => _PyStatus_XXX() * _Py_INIT_FAILED() => _PyStatus_EXCEPTION() * Rename 'err' PyStatus variables to 'status' * Convert RUN_CODE() macro to config_run_code() static inline function * Remove functions: * _Py_InitializeFromArgs() * _Py_InitializeFromWideArgs() * _PyInterpreterState_GetCoreConfig()
* bpo-36785: PEP 574 implementation (GH-7076)Antoine Pitrou2019-05-261-0/+1
|
* bpo-36142: Exclude coreconfig.h from Py_LIMITED_API (GH-12111)Victor Stinner2019-03-011-1/+1
| | | | | | | | | The whole coreconfig.h header is now excluded from Py_LIMITED_API. Move functions definitions into a new internal pycore_coreconfig.h header. * Move Include/coreconfig.h to Include/cpython/coreconfig.h * coreconfig.h header is now excluded from Py_LIMITED_API * Move functions to pycore_coreconfig.h
* bpo-28503: Use crypt_r() when available instead of crypt() (GH-11373)Gregory P. Smith2018-12-301-0/+10
| | | | | Use crypt_r() when available instead of crypt() in the crypt module. As a nice side effect: This also avoids a memory sanitizer flake as clang msan doesn't know about crypt's internal libc allocated buffer.
* bpo-35214: Add _Py_ prefix to MEMORY_SANITIZER def. (GH-10503)Gregory P. Smith2018-11-131-2/+2
| | | | Rename our new MEMORY_SANITIZER define to _Py_MEMORY_SANITIZER. Project based C Preprocessor namespacing at its finest. :P
* bpo-35214: Initial clang MemorySanitizer support (GH-10479)Gregory P. Smith2018-11-121-0/+9
| | | | | | | | | | Adds configure flags for msan and ubsan builds to make it easier to enable. These also encode the detail that address sanitizer and memory sanitizer should disable pymalloc. Define MEMORY_SANITIZER when appropriate at build time and adds workarounds to existing code to mark things as initialized where the sanitizer is otherwise unable to determine that. This lets our build succeed under the memory sanitizer. not all tests pass without sanitizer failures yet but we're in pretty good shape after this.
* bpo-35081: Move Include/pyatomic.c to Include/internal/ (GH-10239)Victor Stinner2018-10-301-2/+0
| | | Add pyatomic.h to the VS project (it wasn't referenced).
* bpo-35053: Add Include/tracemalloc.h (GH-10091)Victor Stinner2018-10-251-0/+1
| | | | | | | * Modify object.h to ensure that pymem.h is included, to get _Py_tracemalloc_config variable. * Move _PyTraceMalloc_XXX() functions to tracemalloc.h, they need PyObject type. Break circular dependency between pymem.h and object.h.
* bpo-34674: Assume unistd.h exists on Unix. (GH-9290)Benjamin Peterson2018-09-141-1/+1
|
* bpo-34170: Add Python/coreconfig.c for _PyCoreConfig (GH-8607)Victor Stinner2018-08-011-0/+1
| | | | | | | * Add Include/coreconfig.h * Move config_*() and _PyCoreConfig_*() functions from Modules/main.c to a new Python/coreconfig.c file. * Inline _Py_ReadHashSeed() into config_init_hash_seed() * Move global configuration variables to coreconfig.c
* bpo-32635: Fix a segfault when importing the crypt module with libxcrypt. ↵stratakis2018-01-231-0/+3
| | | | | | | (#5284) glibc is deprecating libcrypt in favor of libxcrypt, however python assumes that crypt.h will always be included. This change makes the header inclusion explicit when libxcrypt is present on the system.
* bpo-32436: Implement PEP 567 (#5027)Yury Selivanov2018-01-231-0/+1
|
* bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou2017-09-071-1/+1
| | | | | | * Remove Setup.config * Always define WITH_THREAD for compatibility.
* Revert "bpo-30860: Consolidate stateful runtime globals." (#3379)Eric Snow2017-09-061-4/+0
| | | Windows buildbots started failing due to include-related errors.
* bpo-30860: Consolidate stateful runtime globals. (#2594)Eric Snow2017-09-061-0/+4
| | | | | | | | | * group the (stateful) runtime globals into various topical structs * consolidate the topical structs under a single top-level _PyRuntimeState struct * add a check-c-globals.py script that helps identify runtime globals Other globals are excluded (see globals.txt and check-c-globals.py).
* bpo-22257: Small changes for PEP 432. (#1728)Eric Snow2017-05-231-1/+1
| | | PEP 432 specifies a number of large changes to interpreter startup code, including exposing a cleaner C-API. The major changes depend on a number of smaller changes. This patch includes all those smaller changes.
* issue27186: add C version of os.fspath(); patch by Jelle ZijlstraEthan Furman2016-06-041-0/+1
|
* Issue #16991: Add a C implementation of collections.OrderedDict.Eric Snow2015-05-301-0/+1
|
* Issue #22869: Split pythonrun into two modulesNick Coghlan2014-11-201-0/+1
| | | | | | | - interpreter startup and shutdown code moved to a new pylifecycle.c module - Py_OptimizeFlag moved into the new module with the other global flags
* ssue #19183: Implement PEP 456 'secure and interchangeable hash algorithm'.Christian Heimes2013-11-201-0/+1
| | | | Python now uses SipHash24 on all major platforms.
* Eric Snow's implementation of PEP 421.Barry Warsaw2012-06-031-0/+1
| | | | Issue 14673: Add sys.implementation
* Issue #14387: Do not include accu.h from Python.h.Antoine Pitrou2012-03-221-1/+0
|\
| * Issue #14387: Do not include accu.h from Python.h.Antoine Pitrou2012-03-221-1/+0
| |
* | Issue #12911: Fix memory consumption when calculating the repr() of huge ↵Antoine Pitrou2011-10-061-1/+1
|\ \ | |/ | | | | | | | | | | tuples or lists. This introduces a small private API for this common pattern. The issue has been discovered thanks to Martin's huge-mem buildbot.
| * Issue #12911: Fix memory consumption when calculating the repr() of huge ↵Antoine Pitrou2011-10-061-2/+2
| | | | | | | | | | | | | | tuples or lists. This introduces a small private API for this common pattern. The issue has been discovered thanks to Martin's huge-mem buildbot.
* | Enhance Py_ARRAY_LENGTH(): fail at build time if the argument is not an arrayVictor Stinner2011-09-281-18/+1
| | | | | | | | | | | | Move other various macros to pymcacro.h Thanks Rusty Russell for having written these amazing C macros!
* | Move code related to compile from Python.h to compile.hVictor Stinner2011-09-281-19/+0
| |
* | Clean up a few tabs that went in with PEP393.Ezio Melotti2011-09-281-1/+1
| |
* | Rename new macros to conform to naming rules (function macros have "Py" ↵Georg Brandl2011-09-281-3/+3
| | | | | | | | prefix, not "PY").
* | Implement PEP 393.Martin v. Löwis2011-09-281-0/+5
| |
* | Issue #11863: Remove support for legacy systems deprecated in Python 3.2Antoine Pitrou2011-07-081-5/+0
|/ | | | | (following PEP 11). These systems are systems using Mach C Threads, SunOS lightweight processes, GNU pth threads and IRIX threads.
* Merge branches/pep-0384.Martin v. Löwis2010-12-031-0/+4
|
* Include structseq.h in Python.h, and remove now-redundant includes in ↵Georg Brandl2010-11-301-0/+1
| | | | individual sources.
* Create fileutils.c/.hVictor Stinner2010-10-071-11/+1
| | | | | | | * _Py_fopen() and _Py_stat() come from Python/import.c * (_Py)_wrealpath() comes from Python/sysmodule.c * _Py_char2wchar(), _Py_wchar2char() and _Py_wfopen() come from Modules/main.c * (_Py)_wstat(), (_Py)_wgetcwd(), _Py_wreadlink() come from Modules/getpath.c
* Create _Py_fopen() for PyUnicodeObject pathVictor Stinner2010-08-141-1/+2
| | | | | | Call _wfopen() on Windows, or fopen() otherwise. Return the new file object on success, or NULL if the file cannot be open or (if PyErr_Occurred()) on unicode error.
* Issue #9425: Create private _Py_stat() functionVictor Stinner2010-08-141-0/+5
| | | | Use stat() or _wstat() depending on the OS.
* Create _Py_wchar2char() function, reverse of _Py_char2wchar()Victor Stinner2010-08-131-0/+3
| | | | | * Use _Py_wchar2char() in _wstat() and _Py_wfopen() * Document _Py_char2wchar()
* Reimplement addbuilddir() in C inside getpath.c, so as to execute itAntoine Pitrou2010-08-131-1/+2
| | | | | at interpreter startup before importing any non-builtin modules. Should fix #9589.
* Issue #9079: Added _PyTime_gettimeofday(_PyTime_timeval *tp) to C APIAlexander Belopolsky2010-08-051-0/+1
| | | | | | exposed in Python.h. This function is similar to POSIX gettimeofday(struct timeval *tp), but available on platforms without gettimeofday().