| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Ok, pyright has only 10 problems: /home/runner/work/typeshed/typeshed/test_cases/stdlib/builtins/check_exception_group.py /home/runner/work/typeshed/typeshed/test_cases/stdlib/builtins/check_exception_group.py:28:13 - error: "assert_type" mismatch: expected "BaseExceptionGroup[BaseException] | None" but received "BaseExceptionGroup[KeyboardInterrupt | SystemExit] | None" (reportGeneralTypeIssues) /home/runner/work/typeshed/typeshed/test_cases/stdlib/builtins/check_exception_group.py:57:13 - error: "assert_type" mismatch: expected "ExceptionGroup[Exception] | None" but received "ExceptionGroup[ValueError | KeyError] | None" (reportGeneralTypeIssues) /home/runner/work/typeshed/typeshed/test_cases/stdlib/builtins/check_exception_group.py:88:5 - error: "assert_type" mismatch: expected "tuple[BaseExceptionGroup[BaseException] | None, BaseExceptionGroup[SystemExit] | None]" but received "tuple[BaseExceptionGroup[KeyboardInterrupt | SystemExit] | None, BaseExceptionGroup[SystemExit] | None]" (reportGeneralTypeIssues) /home/runner/work/typeshed/typeshed/test_cases/stdlib/builtins/check_exception_group.py:173:13 - error: "assert_type" mismatch: expected "ExceptionGroup[Exception] | None" but received "ExceptionGroup[ValueError | KeyError] | None" (reportGeneralTypeIssues) /home/runner/work/typeshed/typeshed/test_cases/stdlib/builtins/check_exception_group.py:198:5 - error: "assert_type" mismatch: expected "tuple[ExceptionGroup[Exception] | None, ExceptionGroup[ValueError | KeyError] | None]" but received "tuple[ExceptionGroup[TypeError | IndexError] | None, ExceptionGroup[ValueError | KeyError] | None]" (reportGeneralTypeIssues) /home/runner/work/typeshed/typeshed/test_cases/stdlib/builtins/check_exception_group.py:252:13 - error: "assert_type" mismatch: expected "BaseExceptionGroup[BaseException] | None" but received "BaseExceptionGroup[KeyboardInterrupt | SystemExit] | None" (reportGeneralTypeIssues) /home/runner/work/typeshed/typeshed/test_cases/stdlib/builtins/check_exception_group.py:255:13 - error: "assert_type" mismatch: expected "ExceptionGroup[Exception] | None" but received "ExceptionGroup[KeyError | TypeError] | None" (reportGeneralTypeIssues) /home/runner/work/typeshed/typeshed/test_cases/stdlib/builtins/check_exception_group.py:279:13 - error: "assert_type" mismatch: expected "tuple[ExceptionGroup[Exception] | None, BaseExceptionGroup[ValueError] | None]" but received "tuple[ExceptionGroup[TypeError | IndexError] | None, BaseExceptionGroup[ValueError] | None]" (reportGeneralTypeIssues) /home/runner/work/typeshed/typeshed/test_cases/stdlib/builtins/check_exception_group.py:328:13 - error: "assert_type" mismatch: expected "ExceptionGroup[Exception] | None" but received "ExceptionGroup[KeyError | TypeError] | None" (reportGeneralTypeIssues) /home/runner/work/typeshed/typeshed/test_cases/stdlib/builtins/check_exception_group.py:347:13 - error: "assert_type" mismatch: expected "tuple[ExceptionGroup[Exception] | None, ExceptionGroup[ValueError] | None]" but received "tuple[ExceptionGroup[TypeError | IndexError] | None, ExceptionGroup[ValueError] | None]" (reportGeneralTypeIssues) 10 errors, 0 warnings, 0 informations I will add a version guard later on. |
Sorry, something went wrong.
|
Looks like we need some other solution for unused # type: ignore comments. Running mypy --platform darwin --python-version 3.11 on the test cases for 'invoke'... success Running mypy --platform darwin --python-version 3.11 on the test cases for 'requests'... success Running mypy --platform darwin --python-version 3.11 on the standard library test cases... success Running mypy --platform darwin --python-version 3.10 on the test cases for 'invoke'... success Running mypy --platform darwin --python-version 3.10 on the test cases for 'requests'... success Running mypy --platform darwin --python-version 3.10 on the standard library test cases... failure test_cases/stdlib/builtins/check_exception_group.py:47: error: Unused "type: ignore" comment test_cases/stdlib/builtins/check_exception_group.py:48: error: Unused "type: ignore" comment test_cases/stdlib/builtins/check_exception_group.py:67: error: Unused "type: ignore" comment test_cases/stdlib/builtins/check_exception_group.py:71: error: Unused "type: ignore" comment ... |
Sorry, something went wrong.
|
|
||
| # `BaseExceptionGroup` can work with `Exception`: | ||
| beg2 = BaseExceptionGroup("x", [ValueError()]) | ||
| # FIXME: this is not right, runtime returns `ExceptionGroup` instance instead, |
There was a problem hiding this comment.
Should be doable by overriding __new__ (python/mypy#7188), did you try that?
Sorry, something went wrong.
There was a problem hiding this comment.
We have three cases:
Either the first two work or the third one. Suggestions are welcome
Sorry, something went wrong.
|
I have an idea for how to fix the test cases on mypy; I'll get to work on a fix. For flake8: would an alternative fix be to have from builtins import BaseExceptionGroup, ExceptionGroup at the top of the file? |
Sorry, something went wrong.
|
@AlexWaygood, thank you, flake8 idea worked! |
Sorry, something went wrong.
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Sorry, something went wrong.
|
Hooray, CI is finally green 🎉 |
Sorry, something went wrong.
|
I really hope this is correct now! Ping me in case of any problems. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
There are a lot of things going on in this PR:
This is a very complex PR. I would love to provide any of my help to the reviewers.