-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix type hints for root_validator * Add mypy test * Fix mypy test
- Loading branch information
Showing
4 changed files
with
47 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,23 @@ | ||
5: note: "foo" defined here | ||
12: error: Argument 1 to "foo" has incompatible type "str"; expected "int" [arg-type] | ||
13: error: Argument "c" to "foo" has incompatible type "int"; expected "str" [arg-type] | ||
14: error: Too many positional arguments for "foo" [misc] | ||
14: error: Argument 2 to "foo" has incompatible type "int"; expected "str" [arg-type] | ||
15: error: Unexpected keyword argument "d" for "foo" [call-arg] | ||
17: error: "Callable[[int, DefaultNamedArg(str, 'c')], str]" has no attribute "raw_function" [attr-defined] | ||
26: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] | ||
7: note: "foo" defined here | ||
14: error: Argument 1 to "foo" has incompatible type "str"; expected "int" [arg-type] | ||
15: error: Argument "c" to "foo" has incompatible type "int"; expected "str" [arg-type] | ||
16: error: Too many positional arguments for "foo" [misc] | ||
16: error: Argument 2 to "foo" has incompatible type "int"; expected "str" [arg-type] | ||
17: error: Unexpected keyword argument "d" for "foo" [call-arg] | ||
19: error: "Callable[[int, DefaultNamedArg(str, 'c')], str]" has no attribute "raw_function" [attr-defined] | ||
28: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] | ||
33: error: All overload variants of "root_validator" require at least one argument [call-overload] | ||
33: note: Possible overload variants: | ||
33: note: def root_validator(*, skip_on_failure: Literal[True], allow_reuse: bool = ...) -> Callable[[_V1RootValidatorFunctionType], _V1RootValidatorFunctionType] | ||
33: note: def root_validator(*, pre: Literal[True], allow_reuse: bool = ...) -> Callable[[_V1RootValidatorFunctionType], _V1RootValidatorFunctionType] | ||
33: note: def root_validator(*, pre: Literal[False], skip_on_failure: Literal[True], allow_reuse: bool = ...) -> Callable[[_V1RootValidatorFunctionType], _V1RootValidatorFunctionType] | ||
38: error: No overload variant of "root_validator" matches argument types "bool", "bool" [call-overload] | ||
38: note: Possible overload variants: | ||
38: note: def root_validator(*, skip_on_failure: Literal[True], allow_reuse: bool = ...) -> Callable[[_V1RootValidatorFunctionType], _V1RootValidatorFunctionType] | ||
38: note: def root_validator(*, pre: Literal[True], allow_reuse: bool = ...) -> Callable[[_V1RootValidatorFunctionType], _V1RootValidatorFunctionType] | ||
38: note: def root_validator(*, pre: Literal[False], skip_on_failure: Literal[True], allow_reuse: bool = ...) -> Callable[[_V1RootValidatorFunctionType], _V1RootValidatorFunctionType] | ||
43: error: No overload variant of "root_validator" matches argument type "bool" [call-overload] | ||
43: note: Possible overload variants: | ||
43: note: def root_validator(*, skip_on_failure: Literal[True], allow_reuse: bool = ...) -> Callable[[_V1RootValidatorFunctionType], _V1RootValidatorFunctionType] | ||
43: note: def root_validator(*, pre: Literal[True], allow_reuse: bool = ...) -> Callable[[_V1RootValidatorFunctionType], _V1RootValidatorFunctionType] | ||
43: note: def root_validator(*, pre: Literal[False], skip_on_failure: Literal[True], allow_reuse: bool = ...) -> Callable[[_V1RootValidatorFunctionType], _V1RootValidatorFunctionType] |