| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Hm, couple new errors in dd-trace-py raises an interesting question, whether we need to invoke descriptors when they appear as a protocol attribute? Although they are technically defined in the class body, IIUC the intention for them is to be instance variables. Normally we skip descriptors if the variable is implicit (i.e. was set on self), but there is no such thing in protocols. I will try this later today, just to check the possible fallout. |
Sorry, something went wrong.
|
Diff from mypy_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]
|
Sorry, something went wrong.
|
OK, this question reminded me a discussion we had a while ago about what to do for variables annotated with Callable, when should we bind self in them? So I essentially re-use the same logic we agreed on that (which is btw essentially the same story as descriptors are involved under the hood there). I am happy with the primer, so I will be merging this today/tomorrow unless there are objections. |
Sorry, something went wrong.
This is not a pure refactoring, but almost. Right now we are in a weird situation 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 between descriptors and settable properties. This PR fixes these two things. As a nice bonus we should get free support for unions in `__set__()`.
| Back | FazBrowse Home | New Git URL |
This is not a pure refactoring, but almost. Right now we are in a weird situation where we have two inconsistencies:
This PR fixes these two things. As a nice bonus we should get free support for unions in __set__().