Skip to content

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

Open
hyperkai wants to merge 1 commit intopython:mainfrom
hyperkai:hyperkai-patch-2
Open

gh-145524: Update comment for TypeVar S in typing.rst#145525
hyperkai wants to merge 1 commit intopython:mainfrom
hyperkai:hyperkai-patch-2

Conversation

@hyperkai
Copy link

@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
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

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 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

2 participants