Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork3.1k
Handle type[TypeVar] (fixes #14755)#14756
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Handle type[TypeVar] (fixes #14755)#14756
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Diff frommypy_primer, showing the effect of this PR on open source code: steam.py (https://github.com/Gobot1234/steam.py)- steam/app.py:129: note: Maybe you forgot to use "await"?- steam/chat.py:401: error: No overload variant of "__new__" of "type" matches argument type "Type[ChatMessageT]" [call-overload]- steam/chat.py:401: note: Possible overload variants:- steam/chat.py:401: note: def __new__(cls: Type[type], object, /) -> type- steam/chat.py:401: note: def [_typeshed.Self] __new__(cls: Type[_typeshed.Self], str, Tuple[type, ...], Dict[str, Any], /, **kwds: Any) -> _typeshed.Selfurllib3 (https://github.com/urllib3/urllib3)+ test/__init__.py:97: error: Module has no attribute "PROTOCOL_TLS" [attr-defined]+ test/__init__.py:97: note: Error code "attr-defined" not covered by "type: ignore" comment |
sterliakov commentedFeb 22, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
The changes seem legit:
|
hauntsaninja left a comment
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.
Thanks, this looks great!
re: steam/app.py, there is an error for that line, it's just that the error existed both before and after this change so it doesn't show up in the diff. Why the note goes away isn't exactly clear to me, I will take a look later
hauntsaninja commentedMar 15, 2023
Thank you! |
Fixes#14755.
This case is already covered by
check-classes.test::testTypeUsingTypeCClassMethodFromTypeVarUnionBound, now we just remove from it errors that shouldn't be reported.