-
Notifications
You must be signed in to change notification settings - Fork 302
Expand file tree
/
Copy pathgenerics_defaults.toml
More file actions
30 lines (30 loc) · 2.59 KB
/
Copy pathgenerics_defaults.toml
File metadata and controls
30 lines (30 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
conformant = "Partial"
notes = """
Does not detect a `TypeVar` with a default used after a `TypeVarTuple`.
Does not fully support defaults on `TypeVarTuple` and `ParamSpec`.
Incorrectly rejects a valid generic function definition where a TypeVar's
default matches the default value of the corresponding parameter.
"""
output = """
generics_defaults.py:24: error: "T" cannot appear after "DefaultStrT" in type parameter list because it has no default type [misc]
generics_defaults.py:66: error: "AllTheDefaults" expects between 2 and 5 type arguments, but 1 given [type-arg]
generics_defaults.py:139: error: Expression is of type "tuple[*tuple[str, int], ...]", not "tuple[str, int]" [assert-type]
generics_defaults.py:152: error: TypeVar default must be a subtype of the bound type [misc]
generics_defaults.py:159: error: TypeVar default must be one of the constraint types [misc]
generics_defaults.py:177: error: Expression is of type "int", not "Any" [assert-type]
generics_defaults.py:203: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [valid-type]
generics_defaults.py:204: error: Expression is of type "tuple[Any, ...]", not "tuple[int, str]" [assert-type]
generics_defaults.py:205: error: Expression is of type "def (*Any, **Any) -> None", not "Callable[[float, bool], None]" [assert-type]
generics_defaults.py:239: error: Incompatible default for parameter "default" (default has type "None", parameter has type "S8") [assignment]
generics_defaults.py:239: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
generics_defaults.py:239: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
"""
conformance_automated = "Fail"
errors_diff = """
Line 188: Expected 1 errors
Line 139: Unexpected errors ['generics_defaults.py:139: error: Expression is of type "tuple[*tuple[str, int], ...]", not "tuple[str, int]" [assert-type]']
Line 203: Unexpected errors ['generics_defaults.py:203: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [valid-type]']
Line 204: Unexpected errors ['generics_defaults.py:204: error: Expression is of type "tuple[Any, ...]", not "tuple[int, str]" [assert-type]']
Line 205: Unexpected errors ['generics_defaults.py:205: error: Expression is of type "def (*Any, **Any) -> None", not "Callable[[float, bool], None]" [assert-type]']
Line 239: Unexpected errors ['generics_defaults.py:239: error: Incompatible default for parameter "default" (default has type "None", parameter has type "S8") [assignment]']
"""