Skip to content

Conversation

@rodrigodesalvobraz
Copy link

@rodrigodesalvobraz rodrigodesalvobraz commented Dec 2, 2023

a: ProtoA = C  # Type check error, signatures don't match!
b: ProtoB = C  # OK

should be

a: Type[ProtoA] = C  # Type check error, signatures don't match!
b: Type[ProtoB] = C  # OK

because C is a candidate subtype of ProtoA and a subtype of ProtoB

  • Change is either:
    • To a Draft PEP
    • To an Accepted or Final PEP, with Steering Council approval
    • To fix an editorial issue (markup, typo, link, header, etc)
  • PR title prefixed with PEP number (e.g. PEP 123: Summary of changes)

📚 Documentation preview 📚: https://pep-previews--3561.org.readthedocs.build/

…544.rst

a: ProtoB = C
should be
a: Type[ProtoB] = C
because C is a subtype of ProtoB
@ghost
Copy link

ghost commented Dec 2, 2023

All commit authors signed the Contributor License Agreement.
CLA signed

@JelleZijlstra
Copy link
Member

This example is correct; see #2332 for the most thorough discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants