GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |
GeezerVison is showing github.com — Cover two remaining dataclass field() override branches by nileshpatil6 · Pull Request #11679 · microsoft/pyright Conversation
Contributor
Follow-up to #11665, tests only, no behaviour change. #11665 fixed the inherited-default behaviour and its sample covers the plain The ordering caseWhen a defaulted field precedes the override, dropping the inherited default leaves a required parameter after a defaulted one, which CPython rejects when the class is created: @dataclass class Base3: a: int = 0 b: int = 1 @dataclass class OrderOverride(Base3): b: int = field() # TypeError: non-default argument 'b' follows default argument Pyright already reports this correctly, but nothing pinned it. So this is a real, previously unasserted diagnostic rather than a new one. The
|
|
Diff from mypy_primer, showing the effect of this PR on open source code: sympy (https://github.com/sympy/sympy) - .../projects/sympy/sympy/simplify/tests/test_hyperexpand.py:545:30 - error: Cannot access attribute "n" for class "Basic" - Attribute "n" is unknown (reportAttributeAccessIssue) - .../projects/sympy/sympy/simplify/tests/test_hyperexpand.py:547:32 - error: Cannot access attribute "n" for class "Basic" - Attribute "n" is unknown (reportAttributeAccessIssue) - .../projects/sympy/sympy/solvers/bivariate.py:135:15 - error: Operator "-" not supported for "None" (reportOptionalOperand) - .../projects/sympy/sympy/solvers/bivariate.py:139:17 - error: Operator "-" not supported for type "Basic | Unknown" (reportOperatorIssue) - .../projects/sympy/sympy/solvers/bivariate.py:144:23 - error: Operator "-" not supported for "None" (reportOptionalOperand) - .../projects/sympy/sympy/solvers/deutils.py:234:14 - error: Operator "not in" not supported for types "str" and "Unknown | int" - Operator "not in" not supported for types "str" and "int" (reportOperatorIssue) - .../projects/sympy/sympy/solvers/diophantine/diophantine.py:423:38 - error: Argument of type "Unknown | Expr | Literal[0]" cannot be assigned to parameter "expr" of type "Expr" in function "make_args" + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:423:38 - error: Argument of type "int | Expr" cannot be assigned to parameter "expr" of type "Expr" in function "make_args" - Type "Unknown | Expr | Literal[0]" is not assignable to type "Expr" + Type "int | Expr" is not assignable to type "Expr" - "Literal[0]" is not assignable to "Expr" (reportArgumentType) + "int" is not assignable to "Expr" (reportArgumentType) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:504:19 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]" + Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:505:19 - error: Operator "*" not supported for types "Unknown | Basic" and "Unknown | Basic" + Operator "*" not supported for types "Basic" and "Basic" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:506:19 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]" + Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:569:42 - error: Operator "*" not supported for types "int" and "Unknown | Basic" + Operator "*" not supported for types "int" and "Basic" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:569:50 - error: Operator "*" not supported for types "Expr" and "Unknown | Basic" + Operator "*" not supported for types "Expr" and "Basic" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:725:42 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]" + Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:735:19 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]" + Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:736:19 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]" + Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:737:19 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]" + Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:814:47 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]" + Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:841:26 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]" + Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:842:22 - error: Operator "*" not supported for types "Unknown | Basic" and "Unknown | Basic" + Operator "*" not supported for types "Basic" and "Basic" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:843:36 - error: Operator "*" not supported for types "int" and "Unknown | Basic" + Operator "*" not supported for types "int" and "Basic" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:843:42 - error: Operator "*" not supported for types "Unknown | Basic" and "Unknown | Basic" + Operator "*" not supported for types "Basic" and "Basic" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:843:51 - error: Operator "*" not supported for types "int" and "Unknown | Basic" + Operator "*" not supported for types "int" and "Basic" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:843:57 - error: Operator "*" not supported for types "Unknown | Basic" and "Unknown | Basic" + Operator "*" not supported for types "Basic" and "Basic" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:843:66 - error: Operator "*" not supported for types "Unknown | Basic" and "Unknown | Basic" + Operator "*" not supported for types "Basic" and "Basic" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:845:53 - error: Operator "*" not supported for types "Unknown | Basic" and "Unknown | Basic" + Operator "*" not supported for types "Basic" and "Basic" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:854:18 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]" + Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:856:22 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]" + Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:865:22 - error: Operator "*" not supported for types "Unknown | Basic" and "Unknown | Basic" + Operator "*" not supported for types "Basic" and "Basic" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:865:36 - error: Operator "*" not supported for types "Unknown | Basic" and "Unknown | Basic" + Operator "*" not supported for types "Basic" and "Basic" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:867:27 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]" + Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:868:27 - error: Operator "*" not supported for types "Unknown | Basic" and "Unknown | Basic" + Operator "*" not supported for types "Basic" and "Basic" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:869:27 - error: Operator "*" not supported for types "Unknown | Basic" and "Unknown | Basic" + Operator "*" not supported for types "Basic" and "Basic" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:870:27 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]" + Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:871:27 - error: Operator "*" not supported for types "Unknown | Basic" and "Unknown | Basic" + Operator "*" not supported for types "Basic" and "Basic" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:872:27 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]" + Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:876:24 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]" + Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:877:24 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]" + Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:878:24 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]" + Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:879:24 - error: Operator "*" not supported for types "Unknown | Basic" and "Unknown | Basic" + Operator "*" not supported for types "Basic" and "Basic" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:880:24 - error: Operator "*" not supported for types "Unknown | Basic" and "Unknown | Basic" + Operator "*" not supported for types "Basic" and "Basic" (reportOperatorIssue) + .../projects/sympy/sympy/solvers/diophantine/diophantine.py:881:24 - error: Operator "*" not supported for types "Unknown | Basic" and "Unknown | Basic" + Operator "*" not supported for types "Basic" and "Basic" (reportOperatorIssue) ... (truncated 1777 lines) ... |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.