-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
unittest.case
: Further stub improvements
#8077
Merged
Conversation
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
AlexWaygood
commented
Jun 14, 2022
AlexWaygood
commented
Jun 14, 2022
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
These all look good to me.
|
srittau
requested changes
Jun 20, 2022
This comment has been minimized.
This comment has been minimized.
1 similar comment
Diff from mypy_primer, showing the effect of this PR on open source code: poetry (https://github.com/python-poetry/poetry)
- src/poetry/packages/locker.py:316: error: Returning Any from function declared to return "Union[SupportsDunderLT, SupportsDunderGT]" [no-any-return]
+ src/poetry/packages/locker.py:316: error: Returning Any from function declared to return "Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]" [no-any-return]
- src/poetry/packages/locker.py:508: error: Returning Any from function declared to return "Union[SupportsDunderLT, SupportsDunderGT]" [no-any-return]
+ src/poetry/packages/locker.py:508: error: Returning Any from function declared to return "Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]" [no-any-return]
- src/poetry/puzzle/solver.py:138: error: Returning Any from function declared to return "Union[SupportsDunderLT, SupportsDunderGT]" [no-any-return]
+ src/poetry/puzzle/solver.py:138: error: Returning Any from function declared to return "Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]" [no-any-return]
- src/poetry/console/commands/show.py:395: error: Returning Any from function declared to return "Union[SupportsDunderLT, SupportsDunderGT]" [no-any-return]
+ src/poetry/console/commands/show.py:395: error: Returning Any from function declared to return "Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]" [no-any-return]
- src/poetry/console/commands/show.py:439: error: Returning Any from function declared to return "Union[SupportsDunderLT, SupportsDunderGT]" [no-any-return]
+ src/poetry/console/commands/show.py:439: error: Returning Any from function declared to return "Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]" [no-any-return]
freqtrade (https://github.com/freqtrade/freqtrade)
- freqtrade/persistence/pairlock_middleware.py:90: error: Argument "key" to "sorted" has incompatible type "Callable[[PairLock], Column]"; expected "Callable[[PairLock], Union[SupportsDunderLT, SupportsDunderGT]]"
+ freqtrade/persistence/pairlock_middleware.py:90: error: Argument "key" to "sorted" has incompatible type "Callable[[PairLock], Column]"; expected "Callable[[PairLock], Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]]"
- freqtrade/persistence/pairlock_middleware.py:90: error: Incompatible return value type (got "Column", expected "Union[SupportsDunderLT, SupportsDunderGT]")
+ freqtrade/persistence/pairlock_middleware.py:90: error: Incompatible return value type (got "Column", expected "Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]")
core (https://github.com/home-assistant/core)
- homeassistant/components/zwave_js/device_condition.py:225: error: Returning Any from function declared to return "Union[SupportsDunderLT, SupportsDunderGT]" [no-any-return]
+ homeassistant/components/zwave_js/device_condition.py:225: error: Returning Any from function declared to return "Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]" [no-any-return]
- homeassistant/components/zwave_js/device_action.py:330: error: Returning Any from function declared to return "Union[SupportsDunderLT, SupportsDunderGT]" [no-any-return]
+ homeassistant/components/zwave_js/device_action.py:330: error: Returning Any from function declared to return "Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]" [no-any-return]
- homeassistant/components/zwave_js/device_trigger.py:538: error: Returning Any from function declared to return "Union[SupportsDunderLT, SupportsDunderGT]" [no-any-return]
+ homeassistant/components/zwave_js/device_trigger.py:538: error: Returning Any from function declared to return "Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]" [no-any-return]
tornado (https://github.com/tornadoweb/tornado)
+ tornado/test/httpclient_test.py:693: error: Argument 1 to "assertGreaterEqual" of "TestCase" has incompatible type "Optional[float]"; expected "SupportsDunderGE[int]"
+ tornado/test/httpclient_test.py:694: error: Argument 1 to "assertLess" of "TestCase" has incompatible type "Optional[float]"; expected "SupportsDunderLT[float]"
streamlit (https://github.com/streamlit/streamlit)
- lib/tests/streamlit/watcher/local_sources_watcher_test.py:375:47: error: Returning Any from function declared to return "Union[SupportsDunderLT, SupportsDunderGT]" [no-any-return]
+ lib/tests/streamlit/watcher/local_sources_watcher_test.py:375:47: error: Returning Any from function declared to return "Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]" [no-any-return]
paasta (https://github.com/yelp/paasta)
- paasta_tools/metrics/metastatus_lib.py:672: error: Argument "key" to "sorted" has incompatible type "Callable[[Any], Sequence[Tuple[str, str]]]"; expected "Callable[[_SlaveT], Union[SupportsDunderLT, SupportsDunderGT]]"
+ paasta_tools/metrics/metastatus_lib.py:672: error: Argument "key" to "sorted" has incompatible type "Callable[[Any], Sequence[Tuple[str, str]]]"; expected "Callable[[_SlaveT], Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]]"
- paasta_tools/metrics/metastatus_lib.py:672: error: Argument "key" to "sorted" has incompatible type "Callable[[Any], Sequence[Tuple[str, str]]]"; expected "Callable[[Any], Union[SupportsDunderLT, SupportsDunderGT]]"
+ paasta_tools/metrics/metastatus_lib.py:672: error: Argument "key" to "sorted" has incompatible type "Callable[[Any], Sequence[Tuple[str, str]]]"; expected "Callable[[Any], Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]]"
psycopg (https://github.com/psycopg/psycopg)
+ tests/test_psycopg_dbapi20.py:43: error: Unused "type: ignore" comment
+ tests/test_psycopg_dbapi20.py:44: error: Unused "type: ignore" comment
|
srittau
approved these changes
Jun 20, 2022
Thanks! |
DMRobertson
pushed a commit
to matrix-org/synapse
that referenced
this pull request
Sep 28, 2022
Presumably due to python/typeshed#8077
DMRobertson
pushed a commit
to matrix-org/synapse
that referenced
this pull request
Sep 30, 2022
Presumably due to python/typeshed#8077
DMRobertson
pushed a commit
to matrix-org/synapse
that referenced
this pull request
Sep 30, 2022
* Update mypy and mypy-zope * Unignore assigning to LogRecord attributes Presumably python/typeshed#8064 makes this ok Cherry-picked from #13521 * Remove unused ignores due to mypy ParamSpec fixes python/mypy#12668 Cherry-picked from #13521 * Remove additional unused ignores * Fix new mypy complaints related to `assertGreater` Presumably due to python/typeshed#8077 * Changelog * Reword changelog Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com> Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes several things I noticed while preparing #8066.
object
instead ofAny
where literally any argument can be safely passed in.assertGreater
,assertLess
,assertGreaterEqual
andassertLessEqual
.assert(Not)IsInstance
.