summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
Commit message (Collapse)AuthorAgeFilesLines
* gh-125887: Update PyObject_HasAttr exception behavior (#125907)Damien2024-12-271-1/+2
| | | | | Update PyObject_HasAttr exception behavior Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
* Docs: Fix comment out in `c-api/typeobj.rst` (#128266)Yuki Kobayashi2024-12-261-0/+1
|
* GH-122548: Implement branch taken and not taken events for sys.monitoring ↵Mark Shannon2024-12-191-3/+9
| | | | (GH-122564)
* gh-128008: Add `PyWeakref_IsDead()` (GH-128009)Sam Gross2024-12-191-0/+9
| | | | | | | | | The `PyWeakref_IsDead()` function tests if a weak reference is dead without any side effects. Although you can also detect if a weak reference is dead using `PyWeakref_GetRef()`, that function returns a strong reference that must be `Py_DECREF()`'d, which can introduce side effects if the last reference is concurrently dropped (at least in the free threading build).
* Python 3.14.0a3v3.14.0a3Hugo van Kemenade2024-12-171-2/+2
|
* gh-127896: Add missing documentation of `PySequence_In` (GH-127979)Yuki Kobayashi2024-12-161-0/+9
| | | | Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
* gh-102471, PEP 757: Add PyLong import and export API (#121339)Victor Stinner2024-12-131-0/+174
| | | | | Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com> Co-authored-by: Steve Dower <steve.dower@microsoft.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* Document PyObject_SelfIter (#127861)Miro Hrončok2024-12-131-0/+6
|
* gh-118915: C API: Document frame locals proxies. (#127720)Peter Bierma2024-12-111-1/+21
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-127791: Fix, document, and test `PyUnstable_AtExit` (#127793)Peter Bierma2024-12-112-0/+13
|
* gh-126821: Add versionadded annotation to use_system_logger feature. (#127755)Russell Keith-Magee2024-12-101-0/+2
| | | Add versionadded annotation to use_system_logger feature.
* gh-126925: Modify how iOS test results are gathered (#127592)Russell Keith-Magee2024-12-091-0/+9
| | | | | | | Adds a `use_system_log` config item to enable stdout/stderr redirection for Apple platforms. This log streaming is then used by a new iOS test runner script, allowing the display of test suite output at runtime. The iOS test runner script can be used by any Python project, not just the CPython test suite.
* gh-119182: Complete PyUnicodeWriter documentation (#127607)Victor Stinner2024-12-051-0/+9
|
* gh-123378: Ensure results of `PyUnicode*Error_Get{Start,End}` are clamped ↵Bénédikt Tran2024-12-041-2/+18
| | | | | | (GH-123380) Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
* gh-127253: Note that Stable ABI is about ABI stability (GH-127254)Petr Viktorin2024-12-031-3/+11
|
* Docs: Fix incorrect indents in `c-api/type.rst` (#127449)Yuki Kobayashi2024-11-301-25/+23
|
* fix param type in PyObject_HasAttrWithError (docs) (#127403)biggus-developerus2024-11-291-1/+1
|
* gh-69639: Add mixed-mode rules for complex arithmetic (C-like) (GH-124829)Sergey B Kirpichev2024-11-261-0/+54
| | | | | | | | | | | | | | | "Generally, mixed-mode arithmetic combining real and complex variables should be performed directly, not by first coercing the real to complex, lest the sign of zero be rendered uninformative; the same goes for combinations of pure imaginary quantities with complex variables." (c) Kahan, W: Branch cuts for complex elementary functions. This patch implements mixed-mode arithmetic rules, combining real and complex variables as specified by C standards since C99 (in particular, there is no special version for the true division with real lhs operand). Most C compilers implementing C99+ Annex G have only these special rules (without support for imaginary type, which is going to be deprecated in C2y).
* GH-126985: move pyvenv.cfg detection from site to getpath (#126987)Filipe Laíns 🇵🇸2024-11-261-0/+13
|
* gh-107954: Document PEP 741 in What's New 3.14 (#127056)Victor Stinner2024-11-251-0/+4
|
* Fix macro expansions in critical section docs (#127226)da-woods2024-11-241-2/+2
|
* Doc: C API: Fix `Py_NewInterpreterFromConfig` example code (#126667)Richard Hansen2024-11-231-1/+5
|
* Doc: C API: `PyThreadState::on_delete` was removed in v3.13 (#126536)Richard Hansen2024-11-201-0/+3
|
* Python 3.14.0a2v3.14.0a2Hugo van Kemenade2024-11-192-4/+4
|
* gh-125063: marshal: Add version 5, improve documentation (GH-126829)Petr Viktorin2024-11-151-4/+5
| | | | | | | | | | * Document that slices can be marshalled * Deduplicate and organize the list of supported types in docs * Organize the type code list in marshal.c, to make it more obvious that this is a versioned format * Back-fill some historical info Co-authored-by: Michael Droettboom <mdboom@gmail.com>
* gh-123619: Add an unstable C API function for enabling deferred reference ↵Peter Bierma2024-11-131-0/+24
| | | | | | counting (GH-123635) Co-authored-by: Sam Gross <colesbury@gmail.com>
* gh-126061: Add PyLong_IsPositive/Zero/Negative() functions (#126065)RUANG (James Roy)2024-11-121-0/+33
| | | | | Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com> Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* Doc: C API: Demote sections to subsections for consistency (#126535)Richard Hansen2024-11-071-7/+7
| | | | The entire file should be a single section; the headings below the first heading should be subsections.
* Doc: C API: Delete claim that `PyObject_Init` is GC-aware (#126418)Richard Hansen2024-11-051-4/+2
|
* gh-120026: soft deprecate Py_HUGE_VAL macro (#120027)Sergey B Kirpichev2024-11-011-1/+1
| | | Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* gh-125674: Doc: Fix type of `newfunc` first parameter (GH-125675)Richard Hansen2024-10-301-2/+2
| | | | | | | | | * gh-125674: Doc: Fix type of `newfunc` first parameter * fixup! gh-125674: Doc: Fix type of `newfunc` first parameter --------- Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-121654: Add PyType_Freeze() function (#122457)Victor Stinner2024-10-251-0/+14
| | | Co-authored-by: Petr Viktorin <encukou@gmail.com>
* Doc: C API: Move `tp_dealloc` paragraph to `tp_dealloc` section (#125737)Richard Hansen2024-10-211-11/+13
| | | | | | | | | | | | It looks like commit 43cf44ddcce6b225f959ea2a53e4817244ca6054 (gh-31501) accidentally moved the paragraph to the `tp_finalize` section when the intent was to move it to the `tp_dealloc` section (according to the commit message). Also: * Convert the paragraph to a warning. * Apply the appropriate font style to `tp_dealloc`. * Unlinkify the first mention of `tp_dealloc` since the paragraph is already in the `tp_dealloc` section.
* gh-125313: Prefer `sys.base_*` paths in `Py_Get(Exec)Prefix` deprecation ↵Y52024-10-211-4/+7
| | | | | | | notes (#125317) Prefer `sys.base_*` paths in `Py_Get(Exec)Prefix` deprecation notes. Signed-off-by: y5c4l3 <y5c4l3@proton.me>
* Doc: Fix typos (#125728)ember912024-10-213-3/+3
|
* gh-124872: Replace enter/exit events with "switched" (#125532)Kirill Podoprigora2024-10-161-10/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Users want to know when the current context switches to a different context object. Right now this happens when and only when a context is entered or exited, so the enter and exit events are synonymous with "switched". However, if the changes proposed for gh-99633 are implemented, the current context will also switch for reasons other than context enter or exit. Since users actually care about context switches and not enter or exit, replace the enter and exit events with a single switched event. The former exit event was emitted just before exiting the context. The new switched event is emitted after the context is exited to match the semantics users expect of an event with a past-tense name. If users need the ability to clean up before the switch takes effect, another event type can be added in the future. It is not added here because YAGNI. I skipped 0 in the enum as a matter of practice. Skipping 0 makes it easier to troubleshoot when code forgets to set zeroed memory, and it aligns with best practices for other tools (e.g., https://protobuf.dev/programming-guides/dos-donts/#unspecified-enum). Co-authored-by: Richard Hansen <rhansen@rhansen.org> Co-authored-by: Victor Stinner <vstinner@python.org>
* Python 3.14.0a1v3.14.0a1Hugo van Kemenade2024-10-153-5/+5
|
* gh-125512: Revert "gh-124872: Replace enter/exit events with "switched" ↵Kirill Podoprigora2024-10-151-4/+10
| | | | (#124776)" (#125513)
* gh-125517: Fix unreachable code warnings in `_testembed.c` (#125518)sobolevn2024-10-151-6/+10
|
* gh-125234: Make PyInitConfig_Free(NULL) a no-op (#125266)RUANG (Roy James)2024-10-151-0/+2
|
* gh-124872: Replace enter/exit events with "switched" (#124776)Richard Hansen2024-10-141-10/+4
| | | | | | | | | | | | | | | | | | | | | | Users want to know when the current context switches to a different context object. Right now this happens when and only when a context is entered or exited, so the enter and exit events are synonymous with "switched". However, if the changes proposed for gh-99633 are implemented, the current context will also switch for reasons other than context enter or exit. Since users actually care about context switches and not enter or exit, replace the enter and exit events with a single switched event. The former exit event was emitted just before exiting the context. The new switched event is emitted after the context is exited to match the semantics users expect of an event with a past-tense name. If users need the ability to clean up before the switch takes effect, another event type can be added in the future. It is not added here because YAGNI. I skipped 0 in the enum as a matter of practice. Skipping 0 makes it easier to troubleshoot when code forgets to set zeroed memory, and it aligns with best practices for other tools (e.g., https://protobuf.dev/programming-guides/dos-donts/#unspecified-enum).
* gh-101291: Add versionadded directives for PyUnstable_Long_* (#125384)Sergey B Kirpichev2024-10-131-0/+5
|
* gh-124872: Change PyContext_WatchCallback to take PyObject (#124737)Richard Hansen2024-10-121-1/+1
| | | | | The PyContext struct is not intended to be public, and users of the API don't need anything more specific than PyObject. Also see gh-78943.
* gh-124872: Refine contextvars documentation (#124773)Richard Hansen2024-10-091-7/+13
| | | | | | | | | | | | | * Add definitions for "context", "current context", and "context management protocol". * Update related definitions to be consistent with the new definitions. * Restructure the documentation for the `contextvars.Context` class to prepare for adding context manager support, and for consistency with the definitions. * Use `testcode` and `testoutput` to test the `Context.run` example. * Expand the documentation for the `Py_CONTEXT_EVENT_ENTER` and `Py_CONTEXT_EVENT_EXIT` events to clarify and to prepare for planned changes.
* gh-125196: PyUnicodeWriter_Discard(NULL) does nothing (#125222)Victor Stinner2024-10-091-0/+2
|
* gh-101100: Consolidate documentation on `ModuleType` attributes (#124709)Alex Waygood2024-10-092-23/+25
| | | | | | Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Barry Warsaw <barry@python.org> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* bpo-34206: Improve docs and test coverage for pre-init functions (#8023)Alyssa Coghlan2024-10-083-69/+146
| | | | | | | | | | | | | | | | | | | | - move the Py_Main documentation from the very high level API section to the initialization and finalization section - make it clear that it encapsulates a full Py_Initialize/Finalize cycle of its own - point out that exactly which settings will be read and applied correctly when Py_Main is called after a separate runtime initialization call is version dependent - be explicit that Py_IsInitialized can be called prior to initialization - actually test that Py_IsInitialized can be called prior to initialization - flush stdout in the embedding tests that run code so it appears in the expected order when running with "-vv" - make "-vv" on the subinterpreter embedding tests less spammy --------- Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
* gh-70870: Clarify dual usage of 'free variable' (#122545)Alyssa Coghlan2024-10-081-3/+6
| | | | | | | | | | | | | | The term "free variable" has unfortunately become genuinely ambiguous over the years (presumably due to the names of some relevant code object instance attributes). While we can't eliminate that ambiguity at this late date, we can at least alert people to the potential ambiguity by describing both the formal meaning of the term and the common alternative use as a direct synonym for "closure variable". --------- Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
* gh-124502: Add PyUnicode_Equal() function (#124504)Victor Stinner2024-10-071-0/+25
|
* gh-124182: Explain naming rules for struct sequence types (#124335)ffelixg2024-10-071-1/+2
|