Skip to content

gh-156950: Clarify defaultdict documentation - #157033

Open
GruffElixir wants to merge 1 commit into
python:mainfrom
GruffElixir:docs/156950-defaultdict
Open

gh-156950: Clarify defaultdict documentation#157033
GruffElixir wants to merge 1 commit into
python:mainfrom
GruffElixir:docs/156950-defaultdict

Conversation

@GruffElixir

Copy link
Copy Markdown

Summary

  • Clarify how defaultdict handles missing keys when default_factory is set.
  • Document that default_factory should be callable or None, and that other values raise TypeError.

Fixes gh-156950

Testing

  • sphinx-lint --enable default-role Doc/library/collections.rst
  • git diff --check
  • Runtime smoke checks for callable, None, and invalid factories.

Copilot AI lite review requested due to automatic review settings September 6, 2026 13:47
@python-cla-bot

python-cla-bot Bot commented Sep 6, 2026

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app bedevere-app Bot added docs Documentation in the Doc dir skip news labels Sep 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #34417961 | 📁 Comparing f0460ce against main (83dbe6a)

  🔍 Preview build  

1 file changed
± library/collections.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

Defaultdict docs could be clearer

2 participants