Skip to content

gh-145524: Update comment for TypeVar S in typing.rst#145525

Open
hyperkai wants to merge 3 commits into
python:mainfrom
hyperkai:hyperkai-patch-2
Open

gh-145524: Update comment for TypeVar S in typing.rst#145525
hyperkai wants to merge 3 commits into
python:mainfrom
hyperkai:hyperkai-patch-2

Conversation

@hyperkai
Copy link
Copy Markdown
Contributor

@hyperkai hyperkai commented Mar 5, 2026

Clarified the comment for type variable S to specify it can be str or any subtype of str.
Copy link
Copy Markdown
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

The existing text is correct, since str is a subtype of str -- "any subtype of str" includes str itself. But I agree that not all users will necessarily be aware of that, so the edit does seem to make things clearer to me

Comment thread Doc/library/typing.rst Outdated
@serhiy-storchaka serhiy-storchaka added the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label May 30, 2026
@read-the-docs-community
Copy link
Copy Markdown

read-the-docs-community Bot commented Jun 3, 2026

Documentation build overview

📚 cpython-previews | 🛠️ Build #32972593 | 📁 Comparing 1fdc331 against main (6453065)

  🔍 Preview build  

1 file changed
± library/typing.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 needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

What type bound parameter of typing.TypeVar accepts should be explained more clearly

5 participants