Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Correct collections-named-tuple example to use PascalCase assignment #16884

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gopoto
Copy link

@gopoto gopoto commented Mar 21, 2025

Summary

The documentation for collections-named-tuple (PYI024) was using a lowercase variable in its example:

from collections import namedtuple

person = namedtuple("Person", ["name", "age"])

while the recommended replacement used class Person – implying a name change that's not equivalent. This patch updates the docstring to use a more canonical example:

from collections import namedtuple

Person = namedtuple("Person", ["name", "age"])

so that the “Use instead:” block aligns with the original name and doesn't suggest a breaking rename. No functional code changes were required.

Test Plan

Only documentation comments were updated; the existing flake8_pyi tests still pass (cargo test -p ruff_linter). Running the full workspace tests yields a failure in an unrelated snapshot when run as root, but in a typical developer environment the existing tests and snapshots remain unaffected. All style and lint checks pass (cargo clippy, cargo fmt, etc.).


This PR was generated by an AI system in collaboration with maintainers: @carljm, @ntBre

Fixes #16492

…nment

Signed-off-by: Gene Parmesan Thomas <201852096+gopoto@users.noreply.github.com>
@ntBre ntBre added the documentation Improvements or additions to documentation label Mar 21, 2025
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

collections-named-tuple (PYI024): Documented fix is not equivalent
2 participants