Skip to content

Spec change: clarify that assert_type() uses equivalence #45

Description

@JelleZijlstra

Please consider the proposed spec change in python/typing#2011. It specifies that assert_type() uses equivalence, but type checkers are allowed to have an incomplete implementation that rejects some equivalent types. Discussion in https://discuss.python.org/t/specify-that-assert-type-checks-for-equivalence/92967

Signoff:

  • Carl
  • Eric
  • Jelle
  • Jukka
  • Rebecca

Activity

  1. gvanrossum commented on Jun 29, 2025

    @gvanrossum
    Member

    Just a linguistic nit: the subject is unclear to me — does it describe an existing condition that’s undesirable, or a desirable improvement, or something else?

  2. JelleZijlstra commented on Jun 29, 2025

    @JelleZijlstra
    MemberAuthor

    I see it as a clarification of the spec: the current wording in the spec is not clear about how assert_type() behaves; my proposed change makes it more precise.

  3. gvanrossum commented on Jun 29, 2025

    @gvanrossum
    Member

    Cool! If it was my issue I’d work “clarify” in the title somehow. :-)

  4. changed the title [-]Spec change: assert_type() uses equivalence[/-] [+]Spec change: clarify that assert_type() uses equivalence[/+] on Jun 29, 2025
  5. rchen152 commented on Oct 14, 2025

    @rchen152
    Collaborator

    Accepted, thanks!

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions