-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Flip the default for recursive aliases flag #13516
Flip the default for recursive aliases flag #13516
Conversation
This comment has been minimized.
This comment has been minimized.
This actually looks really good. The first big bunch from app_state = self._run('goal-state', return_output=True, use_json=True)
app_state = typing.cast(Dict[str, List[str]], app_state) Mypy obviously rejects such casts, causing massive fallout. (Btw it will probably accept at least some of such casts with Btw a week ago I decided to check how easy it would be to dog-food recursive aliases in mypy, since we have a good candidate: types/nodes (de-)serialization. And it turns out it was quite hard, it looks like we will need a lot of |
This comment has been minimized.
This comment has been minimized.
The |
Oh, the --- a/mypy/semanal.py
+++ b/mypy/semanal.py
@@ -3022,6 +3022,7 @@ class SemanticAnalyzer(
analyzed = self.anal_type(s.type, allow_tuple_literal=allow_tuple_literal)
# Don't store not ready types (including placeholders).
if analyzed is None or has_placeholder(analyzed):
+ # self.defer()
return and this is actually something where I was looking for a long time. Logically that defer should be there, but before I couldn't find any situation where it is needed. And even now I still can't find a minimal repro, there is an import cycle, and the crash depends on very specific order of processing. |
The --- a/mypy/semanal.py
+++ b/mypy/semanal.py
@@ -5097,7 +5097,7 @@ class SemanticAnalyzer(
node is None
or self.is_textually_before_statement(node)
or not self.is_defined_in_current_module(node.fullname)
- or isinstance(node, TypeInfo)
+ or isinstance(node, (TypeInfo, TypeAlias))
or (isinstance(node, PlaceholderNode) and node.becomes_typeinfo)
) |
As `mypy_primer` in #13516 shows, some people actually use this, and I don't see any good reason to not allow this. (Note: I tried to enable the same for recursive NamedTuples and TypedDicts, but this affects how nested classes work in general, so people will need to use qualified names there).
This should fix a crash discovered by `mypy_primer` in #13516 The logic here is that when type aliases have placeholders they are updated _in place_ (the node gets a new resolved target type). But this means that some variables annotated with type aliases may not get stored types, unless we defer targets where they are defined. This didn't cause troubles before, because we waited for type alias to be complete before putting it into symbol table. Now it is not possible, we need to put something into symbol table for partially complete aliases to support recursive aliases (similar to recursive classes). Also, it was tricky to come up with a repro for this issue, because when it happens, the variable gets a "silent" `Any` type, and only when it appears in a dataclass, it causes a crash.
This comment has been minimized.
This comment has been minimized.
…yi/mypy into flip-recursive-default
Diff from mypy_primer, showing the effect of this PR on open source code: operator (https://github.com/canonical/operator)
- ops/model.py:70: error: Module "ops.framework" has no attribute "_SerializedData" [attr-defined]
- ops/model.py:77: error: Cannot resolve name "JsonObject" (possible cyclic definition) [misc]
- ops/model.py:78: error: Cannot resolve name "JsonObject" (possible cyclic definition) [misc]
- ops/model.py:79: error: Cannot resolve name "JsonObject" (possible cyclic definition) [misc]
- ops/model.py:80: error: Cannot resolve name "JsonObject" (possible cyclic definition) [misc]
- ops/model.py:83: error: Cannot resolve name "_K8sSpec" (possible cyclic definition) [misc]
- ops/model.py:2198: error: Incompatible types in assignment (expression has type "Iterable[str]", variable has type "Union[str, float, Dict[str, Any], List[Any], Tuple[Any, ...], None]") [assignment]
+ ops/model.py:2198: error: Incompatible types in assignment (expression has type "Iterable[str]", variable has type "Union[str, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]") [assignment]
+ ops/model.py:2199: error: Item "float" of "Union[Any, float, str, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" has no attribute "split" [union-attr]
+ ops/model.py:2199: error: Item "Dict[str, JsonObject]" of "Union[Any, float, str, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" has no attribute "split" [union-attr]
+ ops/model.py:2199: error: Item "List[JsonObject]" of "Union[Any, float, str, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" has no attribute "split" [union-attr]
+ ops/model.py:2199: error: Item "Tuple[JsonObject, ...]" of "Union[Any, float, str, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" has no attribute "split" [union-attr]
- ops/model.py:2199: error: Item "float" of "Union[str, float, Dict[str, Any], List[Any], Tuple[Any, ...], None]" has no attribute "__iter__" (not iterable) [union-attr]
+ ops/model.py:2199: error: Item "float" of "Union[str, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" has no attribute "__iter__" (not iterable) [union-attr]
- ops/model.py:2199: error: Item "None" of "Union[str, float, Dict[str, Any], List[Any], Tuple[Any, ...], None]" has no attribute "__iter__" (not iterable) [union-attr]
+ ops/model.py:2199: error: Item "None" of "Union[str, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" has no attribute "__iter__" (not iterable) [union-attr]
+ ops/model.py:2354: error: Incompatible types in assignment (expression has type "Dict[str, Dict[str, str]]", variable has type "Union[str, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]") [assignment]
+ ops/model.py:2355: error: Value of type "Union[str, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" is not indexable [index]
+ ops/model.py:2355: error: No overload variant of "__getitem__" of "list" matches argument type "str" [call-overload]
+ ops/model.py:2355: note: Possible overload variants:
+ ops/model.py:2355: note: def __getitem__(self, SupportsIndex, /) -> JsonObject
+ ops/model.py:2355: note: def __getitem__(self, slice, /) -> List[JsonObject]
+ ops/model.py:2355: error: No overload variant of "__getitem__" of "tuple" matches argument type "str" [call-overload]
+ ops/model.py:2355: note: def __getitem__(self, slice, /) -> Tuple[JsonObject, ...]
+ ops/model.py:2355: error: Invalid index type "str" for "Union[str, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]"; expected type "Union[SupportsIndex, slice]" [index]
+ ops/model.py:2356: error: Value of type "Union[str, Any, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" is not indexable [index]
+ ops/model.py:2356: error: No overload variant of "__getitem__" of "list" matches argument type "str" [call-overload]
+ ops/model.py:2356: note: Possible overload variants:
+ ops/model.py:2356: note: def __getitem__(self, SupportsIndex, /) -> JsonObject
+ ops/model.py:2356: note: def __getitem__(self, slice, /) -> List[JsonObject]
+ ops/model.py:2356: error: No overload variant of "__getitem__" of "tuple" matches argument type "str" [call-overload]
+ ops/model.py:2356: note: def __getitem__(self, slice, /) -> Tuple[JsonObject, ...]
+ ops/model.py:2356: error: Incompatible types (expression has type "Union[str, Any, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]", TypedDict item "status" has type "str") [typeddict-item]
+ ops/model.py:2356: error: Invalid index type "str" for "Union[str, Any, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]"; expected type "Union[SupportsIndex, slice]" [index]
+ ops/model.py:2357: error: Value of type "Union[str, Any, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" is not indexable [index]
+ ops/model.py:2357: error: No overload variant of "__getitem__" of "list" matches argument type "str" [call-overload]
+ ops/model.py:2357: note: Possible overload variants:
+ ops/model.py:2357: note: def __getitem__(self, SupportsIndex, /) -> JsonObject
+ ops/model.py:2357: note: def __getitem__(self, slice, /) -> List[JsonObject]
+ ops/model.py:2357: error: No overload variant of "__getitem__" of "tuple" matches argument type "str" [call-overload]
+ ops/model.py:2357: note: def __getitem__(self, slice, /) -> Tuple[JsonObject, ...]
+ ops/model.py:2357: error: Incompatible types (expression has type "Union[str, Any, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]", TypedDict item "message" has type "str") [typeddict-item]
+ ops/model.py:2357: error: Invalid index type "str" for "Union[str, Any, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]"; expected type "Union[SupportsIndex, slice]" [index]
+ ops/model.py:2376: error: Incompatible types in assignment (expression has type "List[str]", variable has type "Union[str, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]") [assignment]
+ ops/model.py:2377: error: Item "float" of "Union[Any, float, str, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" has no attribute "split" [union-attr]
+ ops/model.py:2377: error: Item "Dict[str, JsonObject]" of "Union[Any, float, str, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" has no attribute "split" [union-attr]
+ ops/model.py:2377: error: Item "List[JsonObject]" of "Union[Any, float, str, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" has no attribute "split" [union-attr]
+ ops/model.py:2377: error: Item "Tuple[JsonObject, ...]" of "Union[Any, float, str, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" has no attribute "split" [union-attr]
+ ops/model.py:2377: error: Item "float" of "Union[str, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" has no attribute "__iter__" (not iterable) [union-attr]
+ ops/model.py:2377: error: Item "None" of "Union[str, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" has no attribute "__iter__" (not iterable) [union-attr]
+ ops/model.py:2491: error: Incompatible types in assignment (expression has type "Dict[str, List[str]]", variable has type "Union[str, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]") [assignment]
+ ops/model.py:2493: error: Item "str" of "Union[str, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" has no attribute "get" [union-attr]
+ ops/model.py:2493: error: Item "float" of "Union[str, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" has no attribute "get" [union-attr]
+ ops/model.py:2493: error: Item "List[JsonObject]" of "Union[str, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" has no attribute "get" [union-attr]
+ ops/model.py:2493: error: Item "Tuple[JsonObject, ...]" of "Union[str, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" has no attribute "get" [union-attr]
+ ops/model.py:2493: error: Item "None" of "Union[str, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" has no attribute "get" [union-attr]
+ ops/model.py:2493: error: Argument 1 to "len" has incompatible type "Union[Any, float, Sized]"; expected "Sized" [arg-type]
- ops/framework.py:72: error: Cannot resolve name "_SerializedData" (possible cyclic definition) [misc]
- ops/framework.py:77: error: Cannot resolve name "_StorableType" (possible cyclic definition) [misc]
- ops/framework.py:78: error: Cannot resolve name "_StorableType" (possible cyclic definition) [misc]
- ops/framework.py:79: error: Cannot resolve name "_StorableType" (possible cyclic definition) [misc]
- ops/framework.py:80: error: Cannot resolve name "_StorableType" (possible cyclic definition) [misc]
- ops/framework.py:904: note: def restore(self, snapshot: Dict[str, Union[int, bool, float, str, bytes, None, List[Any], Dict[str, Any], Set[Any]]]) -> None
+ ops/framework.py:904: note: def restore(self, snapshot: Dict[str, _StorableType]) -> None
- ops/framework.py:904: note: def restore(self, snapshot: Dict[str, Union[Union[int, float], bool, str, Dict[str, Any], List[Any], Tuple[Any, ...]]]) -> Any
+ ops/framework.py:904: note: def restore(self, snapshot: _SerializedData) -> Any
- ops/framework.py:904: note: def snapshot(self) -> Dict[str, Union[int, bool, float, str, bytes, None, List[Any], Dict[str, Any], Set[Any]]]
+ ops/framework.py:904: note: def snapshot(self) -> Dict[str, _StorableType]
- ops/framework.py:904: note: def snapshot(self) -> Dict[str, Union[Union[int, float], bool, str, Dict[str, Any], List[Any], Tuple[Any, ...]]]
+ ops/framework.py:904: note: def snapshot(self) -> _SerializedData
- ops/framework.py:1259: note: def __getitem__(self, int, /) -> Union[int, bool, float, str, bytes, None, List[Any], Dict[str, Any], Set[Any]]
+ ops/framework.py:1259: note: def __getitem__(self, int, /) -> _StorableType
- ops/framework.py:1259: note: def __getitem__(self, slice, /) -> MutableSequence[Union[int, bool, float, str, bytes, None, List[Any], Dict[str, Any], Set[Any]]]
+ ops/framework.py:1259: note: def __getitem__(self, slice, /) -> MutableSequence[_StorableType]
- ops/framework.py:1259: note: def __getitem__(self, int, /) -> Union[int, bool, float, str, bytes, None, List[Any], Dict[str, Any], Set[Any]]
+ ops/framework.py:1259: note: def __getitem__(self, int, /) -> _StorableType
- ops/framework.py:1259: note: def __getitem__(self, slice, /) -> Sequence[Union[int, bool, float, str, bytes, None, List[Any], Dict[str, Any], Set[Any]]]
+ ops/framework.py:1259: note: def __getitem__(self, slice, /) -> Sequence[_StorableType]
- ops/framework.py:1262: note: def __setitem__(self, int, Union[int, bool, float, str, bytes, None, List[Any], Dict[str, Any], Set[Any]], /) -> None
+ ops/framework.py:1262: note: def __setitem__(self, int, _StorableType, /) -> None
- ops/framework.py:1262: note: def __setitem__(self, slice, Iterable[Union[int, bool, float, str, bytes, None, List[Any], Dict[str, Any], Set[Any]]], /) -> None
+ ops/framework.py:1262: note: def __setitem__(self, slice, Iterable[_StorableType], /) -> None
+ ops/charm.py:425: error: Return type "_RelationEventSnapshot" of "snapshot" incompatible with return type "_SerializedData" in supertype "EventBase" [override]
- ops/charm.py:43: error: Cannot resolve name "_ActionParam" (possible cyclic definition) [misc]
- ops/charm.py:425: error: Return type "_RelationEventSnapshot" of "snapshot" incompatible with return type "Dict[str, Union[Union[int, float], bool, str, Dict[str, Any], List[Any], Tuple[Any, ...]]]" in supertype "EventBase" [override]
- ops/charm.py:440: error: Argument 1 of "restore" is incompatible with supertype "EventBase"; supertype defines the argument type as "Dict[str, Union[Union[int, float], bool, str, Dict[str, Any], List[Any], Tuple[Any, ...]]]" [override]
+ ops/charm.py:440: error: Argument 1 of "restore" is incompatible with supertype "EventBase"; supertype defines the argument type as "_SerializedData" [override]
- ops/charm.py:540: error: Return type "_RelationDepartedEventSnapshot" of "snapshot" incompatible with return type "Dict[str, Union[Union[int, float], bool, str, Dict[str, Any], List[Any], Tuple[Any, ...]]]" in supertype "EventBase" [override]
+ ops/charm.py:540: error: Return type "_RelationDepartedEventSnapshot" of "snapshot" incompatible with return type "_SerializedData" in supertype "EventBase" [override]
- ops/charm.py:559: error: Argument 1 of "restore" is incompatible with supertype "EventBase"; supertype defines the argument type as "Dict[str, Union[Union[int, float], bool, str, Dict[str, Any], List[Any], Tuple[Any, ...]]]" [override]
+ ops/charm.py:559: error: Argument 1 of "restore" is incompatible with supertype "EventBase"; supertype defines the argument type as "_SerializedData" [override]
- ops/charm.py:598: error: Return type "_StorageEventSnapshot" of "snapshot" incompatible with return type "Dict[str, Union[Union[int, float], bool, str, Dict[str, Any], List[Any], Tuple[Any, ...]]]" in supertype "EventBase" [override]
+ ops/charm.py:598: error: Return type "_StorageEventSnapshot" of "snapshot" incompatible with return type "_SerializedData" in supertype "EventBase" [override]
- ops/charm.py:610: error: Argument 1 of "restore" is incompatible with supertype "EventBase"; supertype defines the argument type as "Dict[str, Union[Union[int, float], bool, str, Dict[str, Any], List[Any], Tuple[Any, ...]]]" [override]
+ ops/charm.py:610: error: Argument 1 of "restore" is incompatible with supertype "EventBase"; supertype defines the argument type as "_SerializedData" [override]
- ops/charm.py:684: error: Return type "_WorkloadEventSnapshot" of "snapshot" incompatible with return type "Dict[str, Union[Union[int, float], bool, str, Dict[str, Any], List[Any], Tuple[Any, ...]]]" in supertype "EventBase" [override]
+ ops/charm.py:684: error: Return type "_WorkloadEventSnapshot" of "snapshot" incompatible with return type "_SerializedData" in supertype "EventBase" [override]
- ops/charm.py:694: error: Argument 1 of "restore" is incompatible with supertype "EventBase"; supertype defines the argument type as "Dict[str, Union[Union[int, float], bool, str, Dict[str, Any], List[Any], Tuple[Any, ...]]]" [override]
+ ops/charm.py:694: error: Argument 1 of "restore" is incompatible with supertype "EventBase"; supertype defines the argument type as "_SerializedData" [override]
- ops/charm.py:914: error: Cannot resolve name "_ActionsRaw" (possible cyclic definition) [misc]
discord.py (https://github.com/Rapptz/discord.py)
- discord/types/threads.py:31: error: Module "discord.types.message" has no attribute "Message"; maybe "MessageType"? [attr-defined]
- discord/types/message.py:124: error: Cannot resolve name "Message" (possible cyclic definition) [misc]
- discord/types/interactions.py:76: error: Cannot resolve name "ApplicationCommandInteractionDataOption" (possible cyclic definition) [misc]
- discord/types/interactions.py:117: error: Cannot resolve name "ApplicationCommandInteractionDataOption" (possible cyclic definition) [misc]
- discord/types/interactions.py:147: error: Cannot resolve name "ApplicationCommandInteractionData" (possible cyclic definition) [misc]
- discord/types/interactions.py:192: error: Cannot resolve name "InteractionData" (possible cyclic definition) [misc]
- discord/types/interactions.py:230: error: Cannot resolve name "Interaction" (possible cyclic definition) [misc]
- discord/interactions.py:169: error: Incompatible types in assignment (expression has type "object", variable has type "Union[Union[ChatInputApplicationCommandInteractionData, UserApplicationCommandInteractionData, MessageApplicationCommandInteractionData], Union[ButtonMessageComponentInteractionData, SelectMessageComponentInteractionData], ModalSubmitInteractionData, None]") [assignment]
+ discord/interactions.py:169: error: Incompatible types in assignment (expression has type "object", variable has type "Union[ApplicationCommandInteractionData, Union[ButtonMessageComponentInteractionData, SelectMessageComponentInteractionData], ModalSubmitInteractionData, None]") [assignment]
- discord/app_commands/tree.py:1131: error: Incompatible types in assignment (expression has type "object", variable has type "List[Union[_CommandGroupApplicationCommandInteractionDataOption, Union[_StringValueApplicationCommandInteractionDataOption, _IntegerValueApplicationCommandInteractionDataOption, _BooleanValueApplicationCommandInteractionDataOption, _SnowflakeValueApplicationCommandInteractionDataOption, _NumberValueApplicationCommandInteractionDataOption]]]") [assignment]
- discord/app_commands/tree.py:1141: error: Incompatible types in assignment (expression has type "object", variable has type "List[Union[_CommandGroupApplicationCommandInteractionDataOption, Union[_StringValueApplicationCommandInteractionDataOption, _IntegerValueApplicationCommandInteractionDataOption, _BooleanValueApplicationCommandInteractionDataOption, _SnowflakeValueApplicationCommandInteractionDataOption, _NumberValueApplicationCommandInteractionDataOption]]]") [assignment]
+ discord/app_commands/tree.py:1131: error: Incompatible types in assignment (expression has type "object", variable has type "List[ApplicationCommandInteractionDataOption]") [assignment]
+ discord/app_commands/tree.py:1141: error: Incompatible types in assignment (expression has type "object", variable has type "List[ApplicationCommandInteractionDataOption]") [assignment]
psycopg (https://github.com/psycopg/psycopg)
+ tests/adapters_example.py:51: error: Unused "type: ignore" comment
pylint (https://github.com/pycqa/pylint)
+ pylint/typing.py:135: error: Unused "type: ignore" comment
sublime_debugger (https://github.com/daveleroy/sublime_debugger)
- modules/ui/html.py:107: error: Cannot resolve name "Children" (possible cyclic definition) [misc]
- modules/ui/html.py:126: error: Cannot resolve name "Children" (possible cyclic definition) [misc]
+ modules/ui/html.py:113: error: Return type "Children" of "render" incompatible with return type "Union[Sequence[element], element, None]" in supertype "element" [override]
+ modules/ui/html.py:132: error: Return type "Children" of "render" incompatible with return type "Union[Sequence[element], element, None]" in supertype "element" [override]
+ modules/views/tabbed_panel.py:98: error: Return type "Children" of "render" incompatible with return type "Union[Sequence[element], element, None]" in supertype "element" [override]
+ modules/views/breakpoints_panel.py:69: error: Return type "Children" of "render" incompatible with return type "Union[Sequence[element], element, None]" in supertype "element" [override]
+ modules/views/variable.py:183: error: Return type "Children" of "render" incompatible with return type "Union[Sequence[element], element, None]" in supertype "element" [override]
+ modules/views/debugger_panel.py:34: error: Return type "Children" of "render" incompatible with return type "Union[Sequence[element], element, None]" in supertype "element" [override]
+ modules/views/debugger_panel.py:122: error: Return type "Children" of "render" incompatible with return type "Children" in supertype "span" [override]
- modules/views/debugger_panel.py:122: error: Return type "Union[Sequence[Any], span, div, None]" of "render" incompatible with return type "Union[Sequence[Any], span, None]" in supertype "span" [override]
+ modules/views/debugger_panel.py:122: error: Return type "Children" of "render" incompatible with return type "Union[Sequence[element], element, None]" in supertype "element" [override]
+ modules/views/debugger_panel.py:174: error: Return type "Children" of "render" incompatible with return type "Union[Sequence[element], element, None]" in supertype "element" [override]
+ modules/views/variables_panel.py:21: error: Return type "Children" of "render" incompatible with return type "Union[Sequence[element], element, None]" in supertype "element" [override]
+ modules/views/variables_panel.py:75: error: Return type "Children" of "render" incompatible with return type "Union[Sequence[element], element, None]" in supertype "element" [override]
+ modules/views/callstack.py:66: error: Return type "Children" of "render" incompatible with return type "Union[Sequence[element], element, None]" in supertype "element" [override]
+ modules/views/callstack.py:108: error: Return type "Children" of "render" incompatible with return type "Union[Sequence[element], element, None]" in supertype "element" [override]
+ modules/views/callstack.py:201: error: Return type "Children" of "render" incompatible with return type "Union[Sequence[element], element, None]" in supertype "element" [override]
+ modules/views/callstack.py:258: error: Return type "Children" of "render" incompatible with return type "Union[Sequence[element], element, None]" in supertype "element" [override]
steam.py (https://github.com/Gobot1234/steam.py)
- steam/game_server.py:23: error: Cannot resolve name "Q" (possible cyclic definition) [misc]
+ steam/game_server.py:255: error: Incompatible return value type (got "Query[T_co]", expected "Query[Q]") [return-value]
+ steam/game_server.py:260: error: Incompatible return value type (got "Query[T_co]", expected "Query[Q]") [return-value]
|
I don't think we need to wait long time for this. As soon as next release goes out, I think we can flip the default. Otherwise, this feature may degrade, because there are just several dozen tests with this flag on.
(Also I am curious to see
mypy_primer
on this.)I manually checked each of couple dozen tests where I currently disable recursive aliases (they essentially just test that there is no crash and emit various errors like
Cannot resolve name
).