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

Conformance tests: Fix automated scoring for dataclasses_usage.toml #1684

Merged
merged 3 commits into from
Apr 7, 2024

Conversation

JelleZijlstra
Copy link
Member

Mark error for unannotated field() as optional. The spec doesn't explicitly mention this case. Since it produces a runtime error, it is reasonable for type checkers to error on it, but it should not be required.

For pytype, mark a few errors as optionally appearing on a different line.
Also, change "x ** 2" to "x * x"; pytype infers "x ** 2" as being of type "float | int"
for whatever reason.

…plus pytype changes

The spec doesn't explicitly mention this case. Since it produces a runtime error,
it is reasonable for type checkers to error on it, but it should not be required.

For pytype, mark a few errors as optionally appearing on a different line.
Also, change "x ** 2" to "x * x"; pytype infers "x ** 2" as being of type "float | int"
for whatever reason.
@JelleZijlstra JelleZijlstra merged commit 112bb36 into python:main Apr 7, 2024
4 checks passed
@JelleZijlstra JelleZijlstra deleted the mypydatcl branch April 7, 2024 10:23
JelleZijlstra added a commit to JelleZijlstra/typing that referenced this pull request Apr 11, 2024
…ython#1684)

Conformance tests: Mark error for unannotated "field()" as optional, plus pytype changes

The spec doesn't explicitly mention this case. Since it produces a runtime error,
it is reasonable for type checkers to error on it, but it should not be required.

For pytype, mark a few errors as optionally appearing on a different line.
Also, change "x ** 2" to "x * x"; pytype infers "x ** 2" as being of type "float | int"
for whatever reason.
@JelleZijlstra JelleZijlstra restored the mypydatcl branch September 10, 2024 23:38
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