Skip to content
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

Fix the stubs for Any #236

Closed
wants to merge 1 commit into from
Closed

Fix the stubs for Any #236

wants to merge 1 commit into from

Conversation

KotlinIsland
Copy link
Collaborator

@KotlinIsland KotlinIsland commented Apr 1, 2024

This is currently causing anything that is Any to be seen as Unknown
Or that it's a real class and nothing is compatible with it.

This comment has been minimized.

@KotlinIsland KotlinIsland changed the title Fix the stubs for Any Fix the stubs for Any Apr 1, 2024
@DetachHead DetachHead self-assigned this Apr 9, 2024
Any: _SpecialForm
else:
class _AnyMeta(type): ...
class Any(metaclass=_AnyMeta): ...
Copy link
Owner

@DetachHead DetachHead Apr 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a good solution but i think the issue is that pyright uses different logic on types in typing.pyi based on whether it's an assignment or not

Suggested change
class Any(metaclass=_AnyMeta): ...
class _Any(metaclass=_AnyMeta): ...
Any = _Any # TEST ONLY

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

rclip (https://github.com/yurijmikhalevich/rclip)
+ /tmp/mypy_primer/projects/rclip/rclip/db.py
+   /tmp/mypy_primer/projects/rclip/rclip/db.py:107:33 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
- 30 errors, 14 warnings, 0 notes
+ 31 errors, 14 warnings, 0 notes

alectryon (https://github.com/cpitclaudel/alectryon)
+   /tmp/mypy_primer/projects/alectryon/alectryon/core.py:38:29 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/alectryon/alectryon/core.py:398:10 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/alectryon/alectryon/core.py:407:27 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
-       Override type "Dict[str, Any]" is not the same as base type "dict[str, (str) -> Any] | None" (reportIncompatibleVariableOverride)
+       Override type "Dict[str, Unknown]" is not the same as base type "dict[str, (str) -> Unknown] | None" (reportIncompatibleVariableOverride)
+   /tmp/mypy_primer/projects/alectryon/alectryon/docutils.py:802:28 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/alectryon/alectryon/docutils.py:903:41 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/alectryon/alectryon/docutils.py:912:38 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/alectryon/alectryon/docutils.py:938:36 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/alectryon/alectryon/docutils.py:1052:40 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/alectryon/alectryon/docutils.py:1082:42 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
-       Override type "Dict[str, Any]" is not the same as base type "dict[str, (str) -> Any] | None" (reportIncompatibleVariableOverride)
+       Override type "Dict[str, Unknown]" is not the same as base type "dict[str, (str) -> Unknown] | None" (reportIncompatibleVariableOverride)
+   /tmp/mypy_primer/projects/alectryon/alectryon/docutils.py:1120:28 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/alectryon/alectryon/docutils.py:1317:59 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/alectryon/alectryon/json.py
+   /tmp/mypy_primer/projects/alectryon/alectryon/json.py:71:24 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/alectryon/alectryon/json.py:79:26 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/alectryon/alectryon/json.py:238:24 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/alectryon/alectryon/json.py:238:32 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/alectryon/alectryon/lean3.py
+   /tmp/mypy_primer/projects/alectryon/alectryon/lean3.py:106:32 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/alectryon/alectryon/lean3.py:163:68 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/alectryon/alectryon/lean4.py
+   /tmp/mypy_primer/projects/alectryon/alectryon/lean4.py:52:79 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/alectryon/alectryon/minimal.py:41:28 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/alectryon/alectryon/serapi.py:65:37 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/alectryon/alectryon/serapi.py:70:33 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/alectryon/alectryon/serapi.py:213:81 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
- 33 errors, 37 warnings, 0 notes
+ 55 errors, 37 warnings, 0 notes

pyp (https://github.com/hauntsaninja/pyp)
-   /tmp/mypy_primer/projects/pyp/pyp.py:12:20 - error: Type of "Any" is Any (reportAny)
+   /tmp/mypy_primer/projects/pyp/pyp.py:60:13 - error: Result of call expression is of type "Any" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/pyp/pyp.py:63:6 - error: Argument of type "(self: Self@NameFinder) -> Set[str]" cannot be assigned to parameter "fget" of type "((Any) -> Any) | None" in function "__init__"
+     Type "(self: Self@NameFinder) -> Set[str]" is incompatible with type "((Any) -> Any) | None"
+       Type "(self: Self@NameFinder) -> Set[str]" is incompatible with type "(Any) -> Any"
+         Parameter 1: type "Any" is incompatible with type "Self@NameFinder"
+           Type "Any" is incompatible with type "Self@NameFinder"
+         Function return type "Set[str]" is incompatible with type "Any"
+           "Set[str]" is incompatible with "Any"
+       "function" is incompatible with "None" (reportArgumentType)
-   /tmp/mypy_primer/projects/pyp/pyp.py:67:30 - error: Type of parameter "value" is Any (reportAny)
+   /tmp/mypy_primer/projects/pyp/pyp.py:71:21 - error: Result of call expression is of type "Any" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/pyp/pyp.py:73:13 - error: Result of call expression is of type "Any" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/pyp/pyp.py:75:9 - error: Method "generic_visit" overrides class "NodeVisitor" in an incompatible manner
+     Return type mismatch: base method returns type "Any", override returns type "None"
+       "None" is incompatible with "Any" (reportIncompatibleMethodOverride)
+   /tmp/mypy_primer/projects/pyp/pyp.py:81:13 - error: Type of "_" is unknown (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/pyp/pyp.py:81:16 - error: Type of "value" is Any (reportAny)
+   /tmp/mypy_primer/projects/pyp/pyp.py:81:16 - error: Type of "value" is unknown (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/pyp/pyp.py:81:25 - error: No overloads for "sorted" match the provided arguments (reportCallIssue)
+   /tmp/mypy_primer/projects/pyp/pyp.py:81:59 - error: Argument of type "(f_v: Tuple[str, Any]) -> int" cannot be assigned to parameter "key" of type "(_T@sorted) -> SupportsRichComparison" in function "sorted"
+     Type "(f_v: Tuple[str, Any]) -> int" is incompatible with type "(tuple[str, Any]) -> SupportsRichComparison"
+       Function return type "int" is incompatible with type "SupportsRichComparison"
+         Type "int" is incompatible with type "SupportsRichComparison"
+           "int" is incompatible with protocol "SupportsDunderLT[Any]"
+             "__lt__" is an incompatible type
+           "int" is incompatible with protocol "SupportsDunderGT[Any]"
+             "__gt__" is an incompatible type (reportArgumentType)
+   /tmp/mypy_primer/projects/pyp/pyp.py:82:33 - error: Argument type is unknown
+     Argument corresponds to parameter "value" in function "flexible_visit" (reportUnknownArgumentType)
+   /tmp/mypy_primer/projects/pyp/pyp.py:84:9 - error: Method "visit_Name" overrides class "NodeVisitor" in an incompatible manner
+     Return type mismatch: base method returns type "Any", override returns type "None"
+       "None" is incompatible with "Any" (reportIncompatibleMethodOverride)
+   /tmp/mypy_primer/projects/pyp/pyp.py:93:9 - error: Method "visit_Global" overrides class "NodeVisitor" in an incompatible manner
+     Return type mismatch: base method returns type "Any", override returns type "None"
+       "None" is incompatible with "Any" (reportIncompatibleMethodOverride)
+   /tmp/mypy_primer/projects/pyp/pyp.py:96:9 - error: Method "visit_Nonlocal" overrides class "NodeVisitor" in an incompatible manner
+     Return type mismatch: base method returns type "Any", override returns type "None"
+       "None" is incompatible with "Any" (reportIncompatibleMethodOverride)
+   /tmp/mypy_primer/projects/pyp/pyp.py:100:9 - error: Method "visit_AugAssign" overrides class "NodeVisitor" in an incompatible manner
+     Return type mismatch: base method returns type "Any", override returns type "None"
+       "None" is incompatible with "Any" (reportIncompatibleMethodOverride)
+   /tmp/mypy_primer/projects/pyp/pyp.py:107:9 - error: Method "visit_NamedExpr" overrides class "NodeVisitor" in an incompatible manner
+     Parameter 2 type mismatch: base parameter is type "NamedExpr", override parameter is type "Any"
+     Return type mismatch: base method returns type "Any", override returns type "None"
+       "NamedExpr" is incompatible with "Any"
+       "None" is incompatible with "Any" (reportIncompatibleMethodOverride)
-   /tmp/mypy_primer/projects/pyp/pyp.py:107:31 - error: Type of parameter "node" is Any (reportAny)
+   /tmp/mypy_primer/projects/pyp/pyp.py:108:9 - error: Result of call expression is of type "Any" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/pyp/pyp.py:108:20 - error: Type of "value" is Any (reportAny)
+   /tmp/mypy_primer/projects/pyp/pyp.py:108:20 - error: Type of "value" is unknown (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/pyp/pyp.py:108:20 - error: Argument type is Any
+   /tmp/mypy_primer/projects/pyp/pyp.py:108:20 - error: Argument type is unknown
-     Argument corresponds to parameter "node" in function "visit" (reportAny)
+     Argument corresponds to parameter "node" in function "visit" (reportUnknownArgumentType)
+   /tmp/mypy_primer/projects/pyp/pyp.py:108:25 - error: Cannot access attribute "value" for class "Any"
+     Attribute "value" is unknown (reportAttributeAccessIssue)
-   /tmp/mypy_primer/projects/pyp/pyp.py:110:27 - error: Type of "target" is Any (reportAny)
+   /tmp/mypy_primer/projects/pyp/pyp.py:110:27 - error: Type of "target" is unknown (reportUnknownMemberType)
+   /tmp/mypy_primer/projects/pyp/pyp.py:110:32 - error: Cannot access attribute "target" for class "Any"
+     Attribute "target" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/pyp/pyp.py:111:32 - error: Cannot access attribute "target" for class "Any"
+     Attribute "target" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/pyp/pyp.py:117:44 - error: Cannot access attribute "target" for class "Any"
+     Attribute "target" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/pyp/pyp.py:119:9 - error: Method "visit_alias" overrides class "NodeVisitor" in an incompatible manner
+     Return type mismatch: base method returns type "Any", override returns type "None"
+       "None" is incompatible with "Any" (reportIncompatibleMethodOverride)
+   /tmp/mypy_primer/projects/pyp/pyp.py:125:9 - error: Method "visit_ImportFrom" overrides class "NodeVisitor" in an incompatible manner
+     Return type mismatch: base method returns type "Any", override returns type "None"
+       "None" is incompatible with "Any" (reportIncompatibleMethodOverride)
+   /tmp/mypy_primer/projects/pyp/pyp.py:130:9 - error: Method "visit_ClassDef" overrides class "NodeVisitor" in an incompatible manner
+     Return type mismatch: base method returns type "Any", override returns type "None"
+       "None" is incompatible with "Any" (reportIncompatibleMethodOverride)
+   /tmp/mypy_primer/projects/pyp/pyp.py:131:29 - error: Argument of type "list[expr]" cannot be assigned to parameter "value" of type "Any" in function "flexible_visit"
+     "list[expr]" is incompatible with "Any" (reportArgumentType)
+   /tmp/mypy_primer/projects/pyp/pyp.py:132:29 - error: Argument of type "list[expr]" cannot be assigned to parameter "value" of type "Any" in function "flexible_visit"
+     "list[expr]" is incompatible with "Any" (reportArgumentType)
+   /tmp/mypy_primer/projects/pyp/pyp.py:133:29 - error: Argument of type "list[keyword]" cannot be assigned to parameter "value" of type "Any" in function "flexible_visit"
+     "list[keyword]" is incompatible with "Any" (reportArgumentType)
+   /tmp/mypy_primer/projects/pyp/pyp.py:136:29 - error: Argument of type "list[stmt]" cannot be assigned to parameter "value" of type "Any" in function "flexible_visit"
+     "list[stmt]" is incompatible with "Any" (reportArgumentType)
-   /tmp/mypy_primer/projects/pyp/pyp.py:141:37 - error: Type of parameter "node" is Any (reportAny)
-   /tmp/mypy_primer/projects/pyp/pyp.py:143:29 - error: Type of "args" is Any (reportAny)
+   /tmp/mypy_primer/projects/pyp/pyp.py:143:29 - error: Type of "args" is unknown (reportUnknownMemberType)
+   /tmp/mypy_primer/projects/pyp/pyp.py:143:29 - error: Argument type is unknown
+     Argument corresponds to parameter "value" in function "flexible_visit" (reportUnknownArgumentType)
+   /tmp/mypy_primer/projects/pyp/pyp.py:143:34 - error: Cannot access attribute "args" for class "Any"
+     Attribute "args" is unknown (reportAttributeAccessIssue)
-   /tmp/mypy_primer/projects/pyp/pyp.py:148:46 - error: Type of "args" is Any (reportAny)
+   /tmp/mypy_primer/projects/pyp/pyp.py:148:46 - error: Type of "args" is unknown (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/pyp/pyp.py:148:46 - error: Argument type is Any
+   /tmp/mypy_primer/projects/pyp/pyp.py:148:46 - error: Argument type is unknown
-     Argument corresponds to parameter "node" in function "iter_child_nodes" (reportAny)
+     Argument corresponds to parameter "node" in function "iter_child_nodes" (reportUnknownArgumentType)
+   /tmp/mypy_primer/projects/pyp/pyp.py:148:51 - error: Cannot access attribute "args" for class "Any"
+     Attribute "args" is unknown (reportAttributeAccessIssue)
-   /tmp/mypy_primer/projects/pyp/pyp.py:151:29 - error: Type of "body" is Any (reportAny)
+   /tmp/mypy_primer/projects/pyp/pyp.py:151:29 - error: Type of "body" is unknown (reportUnknownMemberType)

... (truncated 191 lines) ...

pyinstrument (https://github.com/joerick/pyinstrument)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:12:39 - error: Type of "cast" is partially unknown
+     Type of "cast" is "Overload[(typ: type[_T@cast], val: Unknown) -> _T@cast, (typ: str, val: Unknown) -> Unknown, (typ: object, val: Unknown) -> Unknown]" (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:21:5 - error: Type of "object_with_import_path" is partially unknown
+     Type of "object_with_import_path" is "(import_path: str) -> Unknown" (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:298:9 - error: Type of "f" is partially unknown
+     Type of "f" is "TextIO | Unknown" (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:298:13 - error: Type of "stdout" is partially unknown
+     Type of "stdout" is "TextIO | Unknown" (reportUnknownMemberType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:304:73 - error: Argument type is partially unknown
+     Argument corresponds to parameter "output_file" in function "create_renderer"
+     Argument type is "TextIOWrapper | TextIO | Unknown" (reportUnknownArgumentType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:306:22 - error: Type of "args" is partially unknown
+     Type of "args" is "tuple[Unknown, ...]" (reportUnknownMemberType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:306:22 - error: Argument type is unknown
+     Argument corresponds to parameter "msg" in function "error" (reportUnknownArgumentType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:309:76 - error: Argument type is partially unknown
+     Argument corresponds to parameter "file_obj" in function "file_is_a_tty"
+     Argument type is "TextIOWrapper | TextIO | Unknown" (reportUnknownArgumentType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:330:13 - error: Type of "globs" is partially unknown
+     Type of "globs" is "dict[str, ((mod_name: str, init_globals: dict[str, Unknown] | None = None, run_name: str | None = None, alter_sys: bool = False) -> dict[str, Unknown]) | str]" (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:330:36 - error: Type of "run_module" is partially unknown
+     Type of "run_module" is "(mod_name: str, init_globals: dict[str, Unknown] | None = None, run_name: str | None = None, alter_sys: bool = False) -> dict[str, Unknown]" (reportUnknownMemberType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:352:13 - error: Type of "globs" is partially unknown
+     Type of "globs" is "dict[str, ((path_name: str, init_globals: dict[str, Unknown] | None = None, run_name: str | None = None) -> dict[str, Unknown]) | str]" (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:352:34 - error: Type of "run_path" is partially unknown
+     Type of "run_path" is "(path_name: str, init_globals: dict[str, Unknown] | None = None, run_name: str | None = None) -> dict[str, Unknown]" (reportUnknownMemberType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:373:95 - error: Argument type is partially unknown
+     Argument corresponds to parameter "file_obj" in function "file_is_a_tty"
+     Argument type is "TextIOWrapper | TextIO | Unknown" (reportUnknownArgumentType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:378:9 - error: Type of "write" is partially unknown
+     Type of "write" is "((s: str, /) -> int) | Overload[(s: str, /) -> int, (s: str, /) -> int] | Unknown" (reportUnknownMemberType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:380:13 - error: Type of "close" is partially unknown
+     Type of "close" is "(() -> None) | Unknown" (reportUnknownMemberType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:389:5 - error: Return type, "dict[str, Unknown]", is partially unknown (reportUnknownParameterType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:391:16 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:418:5 - error: Type of "render_options" is partially unknown
+     Type of "render_options" is "dict[str, Unknown]" (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:418:31 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:429:9 - error: Type of "unicode" is unknown (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:429:18 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:430:9 - error: Type of "color" is unknown (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:430:16 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:432:9 - error: Type of "update" is partially unknown
+     Type of "update" is "Overload[(m: SupportsKeysAndGetItem[str, Unknown], /, **kwargs: Unknown) -> None, (m: Iterable[tuple[str, Unknown]], /, **kwargs: Unknown) -> None, (**kwargs: Unknown) -> None]" (reportUnknownMemberType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:446:17 - error: Type of "set_value_at_keypath" is partially unknown
+     Type of "set_value_at_keypath" is "(obj: Unknown, keypath: str, val: Unknown) -> Literal[True]" (reportUnknownMemberType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:451:21 - error: Type of "parsed_value" is unknown (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:451:36 - error: Type of "loads" is partially unknown
+     Type of "loads" is "(s: str | bytes | bytearray, *, cls: type[JSONDecoder] | None = None, object_hook: ((dict[Unknown, Unknown]) -> Unknown) | None = None, parse_float: ((str) -> Unknown) | None = None, parse_int: ((str) -> Unknown) | None = None, parse_constant: ((str) -> Unknown) | None = None, object_pairs_hook: ((list[tuple[Unknown, Unknown]]) -> Unknown) | None = None, **kwds: Unknown) -> Unknown" (reportUnknownMemberType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:456:17 - error: Type of "set_value_at_keypath" is partially unknown
+     Type of "set_value_at_keypath" is "(obj: Unknown, keypath: str, val: Unknown) -> Literal[True]" (reportUnknownMemberType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:458:12 - error: Return type, "dict[str, Unknown]", is partially unknown (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:468:5 - error: Type of "render_options" is partially unknown
+     Type of "render_options" is "dict[str, Unknown]" (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:507:20 - error: Return type is unknown (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/__main__.py:567:5 - error: Type of "sort" is partially unknown
+     Type of "sort" is "Overload[(*, key: None = None, reverse: bool = False) -> None, (*, key: (str) -> (SupportsDunderLT[Unknown] | SupportsDunderGT[Unknown]), reverse: bool = False) -> None]" (reportUnknownMemberType)
+ /tmp/mypy_primer/projects/pyinstrument/pyinstrument/processors.py
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/processors.py:22:30 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/processors.py:25:43 - error: Type of parameter "options" is partially unknown
+     Parameter type is "Dict[str, Unknown]" (reportUnknownParameterType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/processors.py:41:47 - error: Type of parameter "options" is partially unknown
+     Parameter type is "Dict[str, Unknown]" (reportUnknownParameterType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/processors.py:59:51 - error: Type of parameter "options" is partially unknown
+     Parameter type is "Dict[str, Unknown]" (reportUnknownParameterType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/processors.py:95:57 - error: Type of parameter "options" is partially unknown
+     Parameter type is "Dict[str, Unknown]" (reportUnknownParameterType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/processors.py:117:5 - error: Type of "hide_regex" is partially unknown
+     Type of "hide_regex" is "Unknown | None" (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/processors.py:117:30 - error: Type of "get" is partially unknown
+     Type of "get" is "Overload[(key: str, /) -> (Unknown | None), (key: str, default: Unknown, /) -> Unknown, (key: str, default: _T@get, /) -> (Unknown | _T@get)]" (reportUnknownMemberType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/processors.py:118:5 - error: Type of "show_regex" is partially unknown
+     Type of "show_regex" is "Unknown | None" (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/processors.py:118:30 - error: Type of "get" is partially unknown
+     Type of "get" is "Overload[(key: str, /) -> (Unknown | None), (key: str, default: Unknown, /) -> Unknown, (key: str, default: _T@get, /) -> (Unknown | _T@get)]" (reportUnknownMemberType)
+   /tmp/mypy_primer/projects/pyinstrument/pyinstrument/processors.py:123:61 - error: Argument type is unknown

... (truncated 288 lines) ...

mkosi (https://github.com/systemd/mkosi)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:53:57 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:53:64 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:54:38 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:55:56 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:789:52 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:792:68 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:792:92 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:845:63 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:849:73 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:849:102 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:1155:14 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:1167:23 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:1170:21 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:1241:18 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:1250:37 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:1261:37 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:1268:47 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:1268:65 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:1313:36 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:1321:49 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:1321:109 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:1339:48 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:1345:56 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:1631:43 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:1657:36 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:1665:49 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:1665:109 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:1685:48 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:1691:56 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:3356:41 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:3380:62 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:3906:17 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:4091:26 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:4091:34 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:4108:86 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/mkosi/mkosi/config.py:4108:92 - error: Expected type expression but received "_SpecialForm" (reportGeneralTypeIssues)

... (truncated 1549 lines) ...```

@DetachHead
Copy link
Owner

i don't think it's worth jumping down this rabbit hole. all this special cased shit is so messy and probably changes all the time. for now i'm gonna just leave it as-is and fix the semantic highlighting issue in #373

@DetachHead DetachHead closed this May 22, 2024
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