summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
Commit message (Collapse)AuthorAgeFilesLines
* Issue #20517: Removed unnecessary new (short-lived) functions from PyErr.Larry Hastings2014-02-101-25/+0
|
* Issue #20517: Functions in the os module that accept two filenamesLarry Hastings2014-02-101-7/+43
| | | | | | now register both filenames in the exception on failure. This required adding new C API functions allowing OSError exceptions to reference two filenames instead of one.
* Issue #20500: Note other public APIs with the new assertionNick Coghlan2014-02-092-2/+9
|
* Note the new debug assertion in PyObject_StrNick Coghlan2014-02-091-0/+4
|
* Tweaks to What's New and some referenced docsNick Coghlan2014-02-091-1/+1
|
* Issue #17162: Add PyType_GetSlot.Martin v. Löwis2014-02-041-0/+10
|
* Issue #20460: Merge with 3.3Zachary Ware2014-01-311-1/+1
|\
| * Issue #20460: Render 'bytes' as a class, not a function.Zachary Ware2014-01-311-1/+1
| | | | | | | | Patch by OSAMU NAKAMURA.
* | Close #20105: set __traceback__ when chaining exceptions in CNick Coghlan2014-01-261-0/+10
| |
* | Issue #20226: Major improvements to Argument Clinic.Larry Hastings2014-01-161-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * You may now specify an expression as the default value for a parameter! Example: "sys.maxsize - 1". This support is intentionally quite limited; you may only use values that can be represented as static C values. * Removed "doc_default", simplified support for "c_default" and "py_default". (I'm not sure we still even need "py_default", but I'm leaving it in for now in case a use presents itself.) * Parameter lines support a trailing '\\' as a line continuation character, allowing you to break up long lines. * The argument parsing code generated when supporting optional groups now uses PyTuple_GET_SIZE instead of PyTuple_GetSize, leading to a 850% speedup in parsing. (Just kidding, this is an unmeasurable difference.) * A bugfix for the recent regression where the generated prototype from pydoc for builtins would be littered with unreadable "=<object ...>"" default values for parameters that had no default value. * Converted some asserts into proper failure messages. * Many doc improvements and fixes.
* | C API doc: try to group concrete objectsVictor Stinner2013-11-071-7/+15
| |
* | Issue #1772673: The type of `char*` arguments now changed to `const char*`.Serhiy Storchaka2013-10-196-11/+11
| |
* | Issue #16129: Py_SetStandardStreamEncoding cleanupsNick Coghlan2013-10-181-5/+8
| | | | | | | | | | | | | | | | | | - don't call PyErr_NoMemory with interpreter is not initialised - note that it's OK to call _PyMem_RawStrDup here - don't include this in the limited API - capitalise "IO" - be explicit that a non-zero return indicates an error - include versionadded marker in docs
* | Issue #16129: Add `Py_SetStandardStreamEncoding`Nick Coghlan2013-10-171-0/+27
| | | | | | | | | | | | | | | | | | | | | | This new pre-initialization API allows embedding applications like Blender to force a particular encoding and error handler for the standard IO streams. Also refactors Modules/_testembed.c to let us start testing multiple embedding scenarios. (Initial patch by Bastien Montagne)
* | merge with 3.3Georg Brandl2013-10-122-30/+27
|\ \ | |/
| * Introduce support for documenting which C API elements are not part of the ↵Georg Brandl2013-10-122-30/+27
| | | | | | | | stable/limited API.
* | merge with 3.3Georg Brandl2013-10-121-0/+100
|\ \ | |/
| * Closes #13833: document PyStructSequence C-API functions.Georg Brandl2013-10-121-0/+100
| |
* | Close #16742: Fix misuse of memory allocations in PyOS_Readline()Victor Stinner2013-10-101-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The GIL must be held to call PyMem_Malloc(), whereas PyOS_Readline() releases the GIL to read input. The result of the C callback PyOS_ReadlineFunctionPointer must now be a string allocated by PyMem_RawMalloc() or PyMem_RawRealloc() (or NULL if an error occurred), instead of a string allocated by PyMem_Malloc() or PyMem_Realloc(). Fixing this issue was required to setup a hook on PyMem_Malloc(), for example using the tracemalloc module. PyOS_Readline() copies the result of PyOS_ReadlineFunctionPointer() into a new buffer allocated by PyMem_Malloc(). So the public API of PyOS_Readline() does not change.
* | Issue #18874: _PyObject_Malloc/Realloc/Free() now falls back onVictor Stinner2013-10-101-2/+2
| | | | | | | | | | | | _PyMem_RawMalloc/Realloc/Free, instead of _PyMem_Malloc/Realloc/Free. So it becomes possible to use the fast pymalloc allocator for the PYMEM_DOMAIN_MEM domain (PyMem_Malloc/Realloc/Free functions).
* | mergeRaymond Hettinger2013-10-101-6/+5
|\ \ | |/
| * Issue #19005: Fix documentation for PyIter_Next().Raymond Hettinger2013-10-101-6/+5
| |
* | Issue 19195: Improved cross-references in C API documentation.Serhiy Storchaka2013-10-097-27/+28
|\ \ | |/
| * Issue 19195: Improved cross-references in C API documentation.Serhiy Storchaka2013-10-097-27/+28
| |
* | Add a "skull and crossbones" to Py_AddPendingCall.Antoine Pitrou2013-09-301-25/+30
|\ \ | |/
| * Add a "skull and crossbones" to Py_AddPendingCall.Antoine Pitrou2013-09-301-25/+30
| |
* | Close #11619: The parser and the import machinery do not encode UnicodeVictor Stinner2013-08-262-16/+36
| | | | | | | | filenames anymore on Windows.
* | Issue #18743: Fix references to non-existant "StringIO" module.Serhiy Storchaka2013-08-161-1/+1
|\ \ | |/
| * Issue #18743: Fix references to non-existant "StringIO" module.Serhiy Storchaka2013-08-161-1/+1
| |
* | Issue #16400: Add command line option for isolated mode.Christian Heimes2013-08-101-1/+5
| | | | | | | | | | | | | | | | | | | | -I Run Python in isolated mode. This also implies -E and -s. In isolated mode sys.path contains neither the script’s directory nor the user’s site-packages directory. All PYTHON* environment variables are ignored, too. Further restrictions may be imposed to prevent the user from injecting malicious code.
* | Issue #18668: Further clarify m_size setting for non-negative valuesEli Bendersky2013-08-101-4/+4
|\ \ | |/
| * Issue #18668: Further clarify m_size setting for non-negative valuesEli Bendersky2013-08-101-4/+4
| |
* | Fix a typo in PyUnicode_CopyCharacters() documentation.Serhiy Storchaka2013-08-081-1/+1
|\ \ | |/
| * Fix a typo in PyUnicode_CopyCharacters() documentation.Serhiy Storchaka2013-08-081-1/+1
| |
* | Closing #18668: Properly document setting m_size in PyModuleDefEli Bendersky2013-08-071-4/+10
|\ \ | |/
| * Issue #18668: Properly document setting m_size in PyModuleDefEli Bendersky2013-08-071-4/+10
| |
* | Issue #18589: fix hyperlinking of type slots (tp_*)Antoine Pitrou2013-08-015-140/+140
|\ \ | |/
| * Issue #18589: fix hyperlinking of type slots (tp_*)Antoine Pitrou2013-08-015-137/+137
| |
* | Issue #18112: PEP 442 implementation (safe object finalization).Antoine Pitrou2013-07-301-0/+49
| |
* | Issue #3329: Implement the PEP 445Victor Stinner2013-07-071-1/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new enum: * PyMemAllocatorDomain Add new structures: * PyMemAllocator * PyObjectArenaAllocator Add new functions: * PyMem_RawMalloc(), PyMem_RawRealloc(), PyMem_RawFree() * PyMem_GetAllocator(), PyMem_SetAllocator() * PyObject_GetArenaAllocator(), PyObject_SetArenaAllocator() * PyMem_SetupDebugHooks() Changes: * PyMem_Malloc()/PyObject_Realloc() now always call malloc()/realloc(), instead of calling PyObject_Malloc()/PyObject_Realloc() in debug mode. * PyObject_Malloc()/PyObject_Realloc() now falls back to PyMem_Malloc()/PyMem_Realloc() for allocations larger than 512 bytes. * Redesign debug checks on memory block allocators as hooks, instead of using C macros
* | Issue #15767: back out 8a0ed9f63c6e, finishing the removal ofBrett Cannon2013-07-041-2/+0
| | | | | | | | ModuleNotFoundError.
* | Issue #15767: Revert 3a50025f1900 for ModuleNotFoundErrorBrett Cannon2013-07-041-7/+0
| |
* | Revert changeset 6661a8154eb3: Issue #3329: Add new APIs to customize memory ↵Victor Stinner2013-06-151-120/+1
| | | | | | | | | | | | allocators The new API require more discussion.
* | Issue #3329: Add new APIs to customize memory allocatorsVictor Stinner2013-06-141-1/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add a new PyMemAllocators structure * New functions: - PyMem_RawMalloc(), PyMem_RawRealloc(), PyMem_RawFree(): GIL-free memory allocator functions - PyMem_GetRawAllocators(), PyMem_SetRawAllocators() - PyMem_GetAllocators(), PyMem_SetAllocators() - PyMem_SetupDebugHooks() - _PyObject_GetArenaAllocators(), _PyObject_SetArenaAllocators() * Add unit test for PyMem_Malloc(0) and PyObject_Malloc(0) * Add unit test for new get/set allocators functions * PyObject_Malloc() now falls back on PyMem_Malloc() instead of malloc() if size is bigger than SMALL_REQUEST_THRESHOLD, and PyObject_Realloc() falls back on PyMem_Realloc() instead of realloc() * PyMem_Malloc() and PyMem_Realloc() now always call malloc() and realloc(), instead of calling PyObject_Malloc() and PyObject_Realloc() in debug mode
* | Issue #15767: Touch up ModuleNotFoundError usage by import.Brett Cannon2013-06-131-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Forgot to raise ModuleNotFoundError when None is found in sys.modules. This led to introducing the C function PyErr_SetImportErrorSubclass() to make setting ModuleNotFoundError easier. Also updated the reference docs to mention ModuleNotFoundError appropriately. Updated the docs for ModuleNotFoundError to mention the None in sys.modules case. Lastly, it was noticed that PyErr_SetImportError() was not setting an exception when returning None in one case. That issue is now fixed.
* | Issue #15767: Introduce ModuleNotFoundError, a subclass ofBrett Cannon2013-06-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ImportError. The exception is raised by import when a module could not be found. Technically this is defined as no viable loader could be found for the specified module. This includes ``from ... import`` statements so that the module usage is consistent for all situations where import couldn't find what was requested. This should allow for the common idiom of:: try: import something except ImportError: pass to be updated to using ModuleNotFoundError and not accidentally mask ImportError messages that should propagate (e.g. issues with a loader). This work was driven by the fact that the ``from ... import`` statement needed to be able to tell the difference between an ImportError that simply couldn't find a module (and thus silence the exception so that ceval can raise it) and an ImportError that represented an actual problem.
* | Issue #9369: The types of `char*` arguments of PyObject_CallFunction() andSerhiy Storchaka2013-05-291-2/+8
| | | | | | | | | | PyObject_CallMethod() now changed to `const char*`. Based on patches by Jörg Müller and Lars Buitinck.
* | #1554133: Document PyOS_InputHook, PyOS_ReadlineFunctionPointerAndrew Kuchling2013-05-291-1/+23
| |
* | Issue #7330: Implement width and precision (ex: "%5.3s") for the format stringVictor Stinner2013-05-061-0/+11
| | | | | | | | of PyUnicode_FromFormat() function, original patch written by Ysj Ray.
* | #17115,17116: Have modules initialize the __package__ and __loader__Brett Cannon2013-05-041-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | attributes to None. The long-term goal is for people to be able to rely on these attributes existing and checking for None to see if they have been set. Since import itself sets these attributes when a loader does not the only instances when the attributes are None are from someone overloading __import__() and not using a loader or someone creating a module from scratch. This patch also unifies module initialization. Before you could have different attributes with default values depending on how the module object was created. Now the only way to not get the same default set of attributes is to circumvent initialization by calling ModuleType.__new__() directly.