FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

PEP 544: Fix error in "Type[] and class objects vs protocols" section by rodrigodesalvobraz · Pull Request #3561 · python/peps · GitHub

Repository navigation

PEP 544: Fix error in "Type[] and class objects vs protocols" section - #3561

Closed
rodrigodesalvobraz wants to merge 1 commit into
python:mainfrom
rodrigodesalvobraz:main
Closed

rodrigodesalvobraz wants to merge 1 commit into
python:mainfrom
rodrigodesalvobraz:main

Conversation

rodrigodesalvobraz commented Dec 2, 2023 •
edited by github-actions Bot
Loading

Copy link
Copy Markdown
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 commented Dec 2, 2023 •
edited by ghost
Loading

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

Copy link
Copy Markdown
Member

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

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL