GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-141004: Document C APIs for dictionary keys, values, and items by ZeroIntensity · Pull Request #141009 · python/cpython

Conversation

@ZeroIntensity

@ZeroIntensity ZeroIntensity commented Nov 4, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Issue: Document the entire C API #141004

📚 Documentation preview 📚: https://cpython-previews--141009.org.readthedocs.build/en/141009/c-api/dict.html#dictionary-objects

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ZeroIntensity
Document C APIs for dictionary keys, values, and items.
81bcdec
@bedevere-app bedevere-app Bot added awaiting core review docs Documentation in the Doc dir skip news labels Nov 4, 2025
@github-project-automation github-project-automation Bot added this to Docs PRs Nov 4, 2025
@github-project-automation github-project-automation Bot moved this to Todo in Docs PRs Nov 4, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Nov 4, 2025
Document the entire C API #141004
Closed
@ZeroIntensity ZeroIntensity added needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes labels Nov 4, 2025
encukou
encukou reviewed Nov 4, 2025
View reviewed changes
Comment thread Doc/c-api/dict.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@ZeroIntensity @encukou
Update Doc/c-api/dict.rst
de6b12f
Co-authored-by: Petr Viktorin <[email protected]>
ZeroIntensity
ZeroIntensity commented Nov 5, 2025
View reviewed changes
Comment thread Doc/c-api/dict.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/c-api/dict.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/c-api/dict.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

ZeroIntensity added 2 commits November 5, 2025 09:27
@ZeroIntensity
Remove iterator types
fcee529
@ZeroIntensity
Merge branch 'main' into document-missing-dict
823ace9
@ZeroIntensity ZeroIntensity mentioned this pull request Nov 12, 2025
gh-141004: Document PyODict* APIs #141136
Merged
@ZeroIntensity

ZeroIntensity commented Nov 12, 2025

Copy link
Copy Markdown
Member Author

@encukou, this PR is blocking #141136. Are you happy with this?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

picnixz
picnixz reviewed Nov 12, 2025
View reviewed changes
Comment thread Doc/c-api/dict.rst Outdated

.. c:function:: int PyDictViewSet_Check(PyObject *o)

Return true if *o* is a view of a set inside a dictionary. This is currently

@picnixz picnixz Nov 12, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use "op" for the argument as we use it everywhere else for "object pointer"?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@ZeroIntensity ZeroIntensity Nov 12, 2025

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL that's what it stood for, I thought it was "operand". I'll update it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

picnixz reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@ZeroIntensity ZeroIntensity Nov 12, 2025

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@picnixz picnixz Nov 12, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FTR there are other occurrences below

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@ZeroIntensity ZeroIntensity Nov 13, 2025

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, right. Fixed those too.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ZeroIntensity
Use "op" instead of "o".
2cd976b
picnixz
picnixz reviewed Nov 12, 2025
View reviewed changes
Comment thread Doc/c-api/dict.rst
.. c:var:: PyTypeObject PyDictItems_Type

Type object for a view of dictionary items. In Python, this is the type of
the object returned by :meth:`dict.items`.

@picnixz picnixz Nov 12, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we have collections.abc.DictViewSomething? or types.*?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@ZeroIntensity ZeroIntensity Nov 13, 2025

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do, but I'm not sure it's worth pointing to it here, because there's no actual correlation between the two types at runtime.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ZeroIntensity
"o" -> "op" (for real this time)
66f3faa
encukou
encukou approved these changes Nov 13, 2025
View reviewed changes

@encukou encukou left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider:

  • a table to avoid repetitive prose
  • a single “Dict view objects” section with all these and PyDictViewSet_Check

But, the PR is an improvement as is.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Nov 13, 2025
@ZeroIntensity
Add all under one section
a394837
@ZeroIntensity

ZeroIntensity commented Nov 13, 2025

Copy link
Copy Markdown
Member Author

a single “Dict view objects” section with all these and PyDictViewSet_Check

I like that idea, I went with that. I'm not too sure how I would format this under a table.

encukou reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ZeroIntensity
ZeroIntensity enabled auto-merge (squash) November 13, 2025 14:57
@ZeroIntensity
ZeroIntensity merged commit f72768f into python:main Nov 13, 2025
28 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@ZeroIntensity
ZeroIntensity deleted the document-missing-dict branch November 13, 2025 15:02
@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Nov 13, 2025
@miss-islington-app

miss-islington-app Bot commented Nov 13, 2025

Copy link
Copy Markdown

Thanks @ZeroIntensity for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting merge label Nov 13, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 13, 2025
@ZeroIntensity @encukou @miss-islington
pythongh-141004: Document C APIs for dictionary keys, values, and ite…
aeacd57
…ms (pythonGH-141009)

(cherry picked from commit f72768f)

Co-authored-by: Peter Bierma <[email protected]>
Co-authored-by: Petr Viktorin <[email protected]>
@bedevere-app

bedevere-app Bot commented Nov 13, 2025

Copy link
Copy Markdown

GH-141512 is a backport of this pull request to the 3.14 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Nov 13, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 13, 2025
@ZeroIntensity @encukou @miss-islington
pythongh-141004: Document C APIs for dictionary keys, values, and ite…
30d859c
…ms (pythonGH-141009)

(cherry picked from commit f72768f)

Co-authored-by: Peter Bierma <[email protected]>
Co-authored-by: Petr Viktorin <[email protected]>
@bedevere-app

bedevere-app Bot commented Nov 13, 2025

Copy link
Copy Markdown

GH-141513 is a backport of this pull request to the 3.13 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Nov 13, 2025
ZeroIntensity added a commit that referenced this pull request Nov 13, 2025
@miss-islington @ZeroIntensity @encukou
[3.14] gh-141004: Document C APIs for dictionary keys, values, and it…
f43e595
…ems (GH-141009) (GH-141512)

gh-141004: Document C APIs for dictionary keys, values, and items (GH-141009)
(cherry picked from commit f72768f)

Co-authored-by: Peter Bierma <[email protected]>
Co-authored-by: Petr Viktorin <[email protected]>
ZeroIntensity added a commit that referenced this pull request Nov 13, 2025
@miss-islington @ZeroIntensity @encukou
[3.13] gh-141004: Document C APIs for dictionary keys, values, and it…
c38d860
…ems (GH-141009) (GH-141513)

gh-141004: Document C APIs for dictionary keys, values, and items (GH-141009)
(cherry picked from commit f72768f)

Co-authored-by: Peter Bierma <[email protected]>
Co-authored-by: Petr Viktorin <[email protected]>
CuriousLearner added a commit to CuriousLearner/cpython that referenced this pull request Nov 13, 2025
@CuriousLearner
Merge branch 'main' into fix-issue21914
b9f473c
* main: (463 commits)
  pythongh-140601: Add ResourceWarning to iterparse when not closed (pythonGH-140603)
  pythongh-137969: Fix double evaluation of `ForwardRef`s which rely on globals (python#140974)
  pythongh-139109: A new tracing JIT compiler frontend for CPython (pythonGH-140310)
  pythongh-141004: Document `PyErr_RangedSyntaxLocationObject` (python#141521)
  pythongh-140873: Add support of non-descriptor callables in functools.singledispatchmethod() (pythonGH-140884)
  pythongh-139653: Add PyUnstable_ThreadState_SetStackProtection() (python#139668)
  pythongh-141004: Document `PyCode_Optimize` (pythonGH-141378)
  pythongh-141004: Document C APIs for dictionary keys, values, and items (pythonGH-141009)
  pythongh-137959: Fix `TIER1_TO_TIER2` macro name in JIT InternalDocs (pythonGH-141496)
  pythongh-139871: Add `bytearray.take_bytes([n])` to efficiently extract `bytes` (pythonGH-140128)
  pythongh-140601: Refactor ElementTree.iterparse() tests (pythonGH-141499)
  pythongh-135801: Add the module parameter to compile() etc (pythonGH-139652)
  pythongh-140260: fix data race in `_struct` module initialization with subinterpreters (python#140909)
  pythongh-137109: refactor warning about threads when forking (python#141438)
  pythongh-141004: Document `PyRun_InteractiveOneObject` (pythonGH-141405)
  pythongh-124111: Fix TCL 9 thread detection (pythonGH-128103)
  pythongh-141442: Add escaping to iOS testbed arguments (python#141443)
  pythongh-140936: Fix JIT assertion crash at finalization if some generator is alive (pythonGH-140969)
  Add details about JIT build infrastructure and updating dependencies to `Tools/jit` (python#141167)
  pythongh-141412: Use reliable target URL for urllib example (pythonGH-141428)
  ...
CuriousLearner added a commit to CuriousLearner/cpython that referenced this pull request Nov 14, 2025
@CuriousLearner
Merge branch 'main' of github.com:python/cpython into fix-Issue18387
c46ecc5
* 'main' of github.com:python/cpython: (464 commits)
  pythongh-140601: Add ResourceWarning to iterparse when not closed (pythonGH-140603)
  pythongh-137969: Fix double evaluation of `ForwardRef`s which rely on globals (python#140974)
  pythongh-139109: A new tracing JIT compiler frontend for CPython (pythonGH-140310)
  pythongh-141004: Document `PyErr_RangedSyntaxLocationObject` (python#141521)
  pythongh-140873: Add support of non-descriptor callables in functools.singledispatchmethod() (pythonGH-140884)
  pythongh-139653: Add PyUnstable_ThreadState_SetStackProtection() (python#139668)
  pythongh-141004: Document `PyCode_Optimize` (pythonGH-141378)
  pythongh-141004: Document C APIs for dictionary keys, values, and items (pythonGH-141009)
  pythongh-137959: Fix `TIER1_TO_TIER2` macro name in JIT InternalDocs (pythonGH-141496)
  pythongh-139871: Add `bytearray.take_bytes([n])` to efficiently extract `bytes` (pythonGH-140128)
  pythongh-140601: Refactor ElementTree.iterparse() tests (pythonGH-141499)
  pythongh-135801: Add the module parameter to compile() etc (pythonGH-139652)
  pythongh-140260: fix data race in `_struct` module initialization with subinterpreters (python#140909)
  pythongh-137109: refactor warning about threads when forking (python#141438)
  pythongh-141004: Document `PyRun_InteractiveOneObject` (pythonGH-141405)
  pythongh-124111: Fix TCL 9 thread detection (pythonGH-128103)
  pythongh-141442: Add escaping to iOS testbed arguments (python#141443)
  pythongh-140936: Fix JIT assertion crash at finalization if some generator is alive (pythonGH-140969)
  Add details about JIT build infrastructure and updating dependencies to `Tools/jit` (python#141167)
  pythongh-141412: Use reliable target URL for urllib example (pythonGH-141428)
  ...
CuriousLearner added a commit to CuriousLearner/cpython that referenced this pull request Nov 14, 2025
@CuriousLearner
Merge branch 'main' of github.com:python/cpython into fix-issue24255
c240289
* 'main' of github.com:python/cpython: (464 commits)
  pythongh-140601: Add ResourceWarning to iterparse when not closed (pythonGH-140603)
  pythongh-137969: Fix double evaluation of `ForwardRef`s which rely on globals (python#140974)
  pythongh-139109: A new tracing JIT compiler frontend for CPython (pythonGH-140310)
  pythongh-141004: Document `PyErr_RangedSyntaxLocationObject` (python#141521)
  pythongh-140873: Add support of non-descriptor callables in functools.singledispatchmethod() (pythonGH-140884)
  pythongh-139653: Add PyUnstable_ThreadState_SetStackProtection() (python#139668)
  pythongh-141004: Document `PyCode_Optimize` (pythonGH-141378)
  pythongh-141004: Document C APIs for dictionary keys, values, and items (pythonGH-141009)
  pythongh-137959: Fix `TIER1_TO_TIER2` macro name in JIT InternalDocs (pythonGH-141496)
  pythongh-139871: Add `bytearray.take_bytes([n])` to efficiently extract `bytes` (pythonGH-140128)
  pythongh-140601: Refactor ElementTree.iterparse() tests (pythonGH-141499)
  pythongh-135801: Add the module parameter to compile() etc (pythonGH-139652)
  pythongh-140260: fix data race in `_struct` module initialization with subinterpreters (python#140909)
  pythongh-137109: refactor warning about threads when forking (python#141438)
  pythongh-141004: Document `PyRun_InteractiveOneObject` (pythonGH-141405)
  pythongh-124111: Fix TCL 9 thread detection (pythonGH-128103)
  pythongh-141442: Add escaping to iOS testbed arguments (python#141443)
  pythongh-140936: Fix JIT assertion crash at finalization if some generator is alive (pythonGH-140969)
  Add details about JIT build infrastructure and updating dependencies to `Tools/jit` (python#141167)
  pythongh-141412: Use reliable target URL for urllib example (pythonGH-141428)
  ...
StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull request Dec 6, 2025
@ZeroIntensity @encukou @StanFromIreland
pythongh-141004: Document C APIs for dictionary keys, values, and ite…
9ddca3e
…ms (pythonGH-141009)

Co-authored-by: Petr Viktorin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@picnixz picnixz picnixz left review comments
@encukou encukou encukou approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

docs Documentation in the Doc dir skip news

Projects

Docs PRs
Status: Done

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@ZeroIntensity @encukou @picnixz
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.