-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Sync typeshed #12663
Merged
Merged
Sync typeshed #12663
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
Source commit: python/typeshed@5dad506
JelleZijlstra
approved these changes
Apr 23, 2022
This comment has been minimized.
This comment has been minimized.
JelleZijlstra
added a commit
to JelleZijlstra/werkzeug
that referenced
this pull request
Apr 23, 2022
If you don't care what the callable returns, it's better to use `object` so users can pass a callable that returns something else. For example, some `.write()` methods return the number of bytes written. Noticed this in python/mypy#12663.
and you checked the kornia ones in python/typeshed#7655 (comment) |
Diff from mypy_primer, showing the effect of this PR on open source code: rclip (https://github.com/yurijmikhalevich/rclip)
+ rclip/db.py:70: error: Argument 1 to "update" of "MutableMapping" has incompatible type "NewImage"; expected "SupportsKeysAndGetItem[str, None]"
+ rclip/db.py:70: note: def __getitem__(self, str) -> None
- rclip/db.py:70: error: Argument 1 to "update" of "MutableMapping" has incompatible type "NewImage"; expected "SupportsKeysAndGetItem[Any, None]"
- rclip/db.py:70: note: def __getitem__(self, Any) -> None
kornia (https://github.com/kornia/kornia)
+ kornia/augmentation/container/image.py:331: error: Invalid index type "Union[str, Any]" for "List[ParamItem]"; expected type "SupportsIndex" [index]
+ kornia/augmentation/container/image.py:340: error: Item "None" of "Union[ParamItem, Any, None]" has no attribute "data" [union-attr]
+ kornia/augmentation/container/image.py:340: error: Argument 2 to "inverse" of "ImageSequential" has incompatible type "Union[Dict[Any, Any], List[Any], None, Any]"; expected "Optional[List[ParamItem]]" [arg-type]
+ kornia/augmentation/container/augment.py:221: error: Invalid index type "Union[str, Any]" for "List[ParamItem]"; expected type "SupportsIndex" [index]
werkzeug (https://github.com/pallets/werkzeug)
+ src/werkzeug/middleware/lint.py:414: error: Argument 1 to "GuardedWrite" has incompatible type "Callable[[bytes], object]"; expected "Callable[[bytes], None]" [arg-type]
- tests/test_wrappers.py:1109: error: Function is missing a return type annotation [no-untyped-def]
core (https://github.com/home-assistant/core)
- homeassistant/components/sonos/media.py:138: error: Argument 1 to "int" has incompatible type "Optional[Any]"; expected "Union[str, bytes, SupportsInt, SupportsIndex, SupportsTrunc]" [arg-type]
+ homeassistant/components/sonos/media.py:138: error: Argument 1 to "int" has incompatible type "Optional[Any]"; expected "Union[str, bytes, array[Any], mmap, _CData, SupportsInt, SupportsIndex, SupportsTrunc]" [arg-type]
|
davidism
pushed a commit
to JelleZijlstra/werkzeug
that referenced
this pull request
Apr 24, 2022
If you don't care what the callable returns, it's better to use `object` so users can pass a callable that returns something else. For example, some `.write()` methods return the number of bytes written. Noticed this in python/mypy#12663.
DamianZaremba
added a commit
to DamianZaremba/django-stubs
that referenced
this pull request
May 25, 2022
- Updates test_model_field_classes_from_existing_locations to account for the behaviour change in python/mypy#12663 - Bumps the version of django-stubs for a new release
sobolevn
pushed a commit
to typeddjango/django-stubs
that referenced
this pull request
May 25, 2022
- Updates test_model_field_classes_from_existing_locations to account for the behaviour change in python/mypy#12663 - Bumps the version of django-stubs for a new release
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.
Source commit:
python/typeshed@5dad506