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 — What type `bound` parameter of `typing.TypeVar` accepts should be explained more clearly · Issue #145524 · python/cpython

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

New issue
Copy link
New issue
Copy link
Open
#145525
Open
What type bound parameter of typing.TypeVar accepts should be explained more clearly#145524
#145525
Copy link
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dirtopic-typingtriagedThe issue has been accepted as valid by a triager.The issue has been accepted as valid by a triager.

Description

@hyperkai
hyperkai
opened on Mar 5, 2026
Issue body actions

Documentation

*Notes:

  • Python 3.14.3

For T and A, what type is accepted is clearly explained in the example of typing.TypeVar while for S isn't explained clearly even though str itself is also accepted as shown below:

T = TypeVar('T')  # Can be anything
S = TypeVar('S', bound=str)  # Can be any subtype of str <- Here
A = TypeVar('A', str, bytes)  # Must be exactly str or bytes

So, S should be explained more clearly as shown below:

S = TypeVar('S', bound=str)  # Can be str or any subtype of str

Linked PRs

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

Activity

  1. hyperkai
    added
    docsDocumentation in the Doc dirDocumentation in the Doc dir
    on Mar 5, 2026
  2. github-project-automation
    added this to docs issueson Mar 5, 2026
  3. github-project-automation
    moved this to Todo in docs issueson Mar 5, 2026
  4. aisk
    added
    topic-typing
    on Mar 5, 2026
  5. picnixz commented on Mar 5, 2026

    @picnixz
    picnixz
    on Mar 5, 2026
    Member
    More actions

    T is a subtype of itself so I don't think it should be changed.

  6. picnixz
    added
    pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is provided
    on Mar 5, 2026
  7. picnixz commented on Mar 5, 2026

    @picnixz
    picnixz
    on Mar 5, 2026
    Member
    More actions

    Ok, nvm, Alex was ok with the PR.

  8. picnixz
    added
    triagedThe issue has been accepted as valid by a triager.The issue has been accepted as valid by a triager.
    and removed
    pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is provided
    on Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dirDocumentation in the Doc dirtopic-typingtriagedThe issue has been accepted as valid by a triager.The issue has been accepted as valid by a triager.

    Projects

    • docs issues
      Status
      Todo
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    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.