Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork3.1k
Consolidate descriptor handling in checkmember.py#18831
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This comment has been minimized.
This comment has been minimized.
ilevkivskyi commentedMar 22, 2025
Hm, couple new errors in I will try this later today, just to check the possible fallout. |
This comment has been minimized.
This comment has been minimized.
Diff frommypy_primer, showing the effect of this PR on open source code: kornia (https://github.com/kornia/kornia)- kornia/augmentation/container/augment.py:449: error: Unsupported right operand type for in ("list[DataKey] | None") [operator]- kornia/augmentation/container/augment.py:450: error: Item "None" of "list[DataKey] | None" has no attribute "index" [union-attr]+ kornia/augmentation/container/augment.py:321: error: Unused "type: ignore" comment [unused-ignore]+ kornia/augmentation/container/augment.py:323: error: Unused "type: ignore" comment [unused-ignore]+ kornia/augmentation/container/augment.py:443: error: Unused "type: ignore" comment [unused-ignore]+ kornia/augmentation/container/augment.py:445: error: Unused "type: ignore" comment [unused-ignore]steam.py (https://github.com/Gobot1234/steam.py)+ steam/state.py:2427: error: Argument "targetid" to "AddReactionRequest" has incompatible type "int | _ReadOnlyProto[int]"; expected "int" [arg-type]+ steam/state.py:2440: error: Argument "targetid" to "GetReactionsRequest" has incompatible type "int | _ReadOnlyProto[int]"; expected "int" [arg-type]dd-trace-py (https://github.com/DataDog/dd-trace-py)+ ddtrace/internal/wrapping/__init__.py:301: error: Unused "type: ignore" comment [unused-ignore] |
ilevkivskyi commentedMar 22, 2025
OK, this question reminded me a discussion we had a while ago about what to do for variables annotated with I am happy with the primer, so I will be merging this today/tomorrow unless there are objections. |
df9ddfc intopython:masterUh oh!
There was an error while loading.Please reload this page.
This is not a pure refactoring, but almost. Right now we are in a weirdsituation where we have two inconsistencies:* `__set__()` is handled in `checker.py` while `__get__()` is handled in`checkmember.py`* rules for when to use binder are slightly different betweendescriptors and settable properties.This PR fixes these two things. As a nice bonus we should get freesupport for unions in `__set__()`.
Uh oh!
There was an error while loading.Please reload this page.
This is not a pure refactoring, but almost. Right now we are in a weird situation where we have two inconsistencies:
__set__()is handled inchecker.pywhile__get__()is handled incheckmember.pyThis PR fixes these two things. As a nice bonus we should get free support for unions in
__set__().