You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you apply @hauntsaninja's patch to mypy_test.py in python/mypy#12220, here is the output when running python tests/mypy_test.py -p3.11 on the master branch (using Python 3.10, mypy 0.931):
stdlib\typing.pyi:1166: error: Variable "typing.Never" is not valid as a type [valid-type]
stdlib\typing.pyi:1166: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
stdlib\builtins.pyi:1713: error: Value of type "Type[type]" is not indexable [index]
stdlib\builtins.pyi:1721: error: Variable "builtins._SplitCondition" is not valid as a type [valid-type]
stdlib\builtins.pyi:1721: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
stdlib\builtins.pyi:1722: error: Variable "builtins._SplitCondition" is not valid as a type [valid-type]
stdlib\builtins.pyi:1722: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
stdlib\enum.pyi:141: error: Decorated property not supported [misc]
stdlib\enum.pyi:143: error: Decorated property not supported [misc]
stdlib\enum.pyi:172: error: Decorated property not supported [misc]
stdlib\enum.pyi:192: error: Signature of "value" incompatible with supertype "Flag" [override]
stdlib\enum.pyi:203: error: Decorated property not supported [misc]
stdlib\enum.pyi:205: error: Decorated property not supported [misc]
stdlib\enum.pyi:233: error: Decorated property not supported [misc]
stdlib\enum.pyi:236: error: Cannot inherit from final class "StrEnum" [misc]
stdlib\enum.pyi:248: error: Cannot inherit from final class "StrEnum" [misc]
stdlib\asyncio\base_events.pyi:301: error: Signature of "create_datagram_endpoint" incompatible with supertype "AbstractEventLoop" [override]
stdlib\asyncio\base_events.pyi:301: note: Superclass:
stdlib\asyncio\base_events.pyi:301: note: def [_ProtocolT <: BaseProtocol] create_datagram_endpoint(self, protocol_factory: Callable[[], _ProtocolT], local_addr: Optional[Tuple[str, int]] = ..., remote_addr: Optional[Tuple[str, int]] = ..., *, family: int = ..., proto: int = ..., flags: int = ..., reuse_address: Optional[bool] = ..., reuse_port: Optional[bool] = ..., allow_broadcast: Optional[bool] = ..., sock: Optional[socket] = ...) -> Coroutine[Any, Any, Tuple[BaseTransport, _ProtocolT]]
stdlib\asyncio\base_events.pyi:301: note: Subclass:
stdlib\asyncio\base_events.pyi:301: note: def [_ProtocolT <: BaseProtocol] create_datagram_endpoint(self, protocol_factory: Callable[[], _ProtocolT], local_addr: Optional[Tuple[str, int]] = ..., remote_addr: Optional[Tuple[str, int]] = ..., *, family: int = ..., proto: int = ..., flags: int = ..., reuse_port: Optional[bool] = ..., allow_broadcast: Optional[bool] = ..., sock: Optional[socket] = ...) -> Coroutine[Any, Any, Tuple[BaseTransport, _ProtocolT]]
Here is the output when running python tests/mypy_test.py -p3.11 with this patch applied:
stdlib\typing.pyi:1166: error: Variable "typing.Never" is not valid as a type [valid-type]
stdlib\typing.pyi:1166: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
stdlib\enum.pyi:222: error: Cannot inherit from final class "StrEnum" [misc]
stdlib\enum.pyi:234: error: Cannot inherit from final class "StrEnum" [misc]
Thanks! Are the Never errors with mypy master or the latest release?
With the latest release (0.931); I assume (though I haven't checked) that python/mypy#12153 fixes them. I'll try running the same test with mypy master and get back to you.
And the StrEnum errors seem like a mypy bug, do you know if it's already tracked?
Okay, if I run mypy_test.py -p3.11 using mypy master, the Never errors and the StrEnum errors go away. There is however this new error, which also seems like a mypy bug:
stdlib\enum.pyi:172: error: Only a single data type mixin is allowed for Enum subtypes, found extra "enum.ReprEnum" [misc]
stdlib\enum.pyi:213: error: Only a single data type mixin is allowed for Enum subtypes, found extra "enum.ReprEnum" [misc]
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
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.
If you apply @hauntsaninja's patch to
mypy_test.pyin python/mypy#12220, here is the output when runningpython tests/mypy_test.py -p3.11on the master branch (using Python 3.10, mypy 0.931):Here is the output when running
python tests/mypy_test.py -p3.11with this patch applied: