-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify some behavior around user-defined generic classes #1879
Merged
Conversation
This file contains 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
5 tasks
sobolevn
reviewed
Oct 31, 2024
erictraut
reviewed
Nov 1, 2024
erictraut
approved these changes
Nov 1, 2024
JelleZijlstra
approved these changes
Nov 19, 2024
JukkaL
approved these changes
Nov 20, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, but one thing seemed a little unclear.
All TC members have either directly approved this PR or signed off at python/typing-council#38. |
carljm
added a commit
to erictraut/typing
that referenced
this pull request
Jan 9, 2025
* main: (29 commits) Updated conformance test results for the latest versions of type chec… (python#1904) Add content from typeshed/CONTRIBUTING.md (python#1882) Fix markup in generics specification (python#1900) Specs clarification: Forbid `ClassVar` and `Final` within `TypedDict` body (python#1890) Remove paragraph mentioning minor edits through the mailing list (python#1891) Writing Stubs: Add "Overloads and Flags" section (python#1894) Fix a typo (python#1893) Update conformance tests for recent generics spec change (python#1892) Clarify some behavior around user-defined generic classes (python#1879) Modernizing guide: Mention TypeGuard/TypeIs (python#1887) Tools can perform "some" refactorings (python#1886) Mention use of cast in enum type stub example (python#1877) Update conformance results after new pyre release (python#1878) Add a label for typed dictionaries class-based syntax (python#1873) Add missing return type to generic_syntax_infer_variance.py (python#1871) Updated conformance results for mypy 1.13 and pyright 1.1.386 (python#1870) Modernizing guide: also mention `com2ann` (python#1869) Suggest `pyupgrade` or `ruff` for modernizing superseded typing features (python#1868) Updated conformance results for pyright 1.1.385. (python#1867) Updated conformance results for mypy 1.12. (python#1866) ...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Protocol[T]
behaves likeGeneric[T]
when defining a generic class.Generic[T]
andProtocol[T]
.Generic[T]
is omitted, type variables are taken in order of first appearance in generic base classes.Discussion: https://discuss.python.org/t/clarifying-the-rules-for-subclassing-generic-classes/69698.