[ty] Address intersection receiver review feedback#25819
Merged
Conversation
Typing conformance resultsNo changes detected ✅Current numbersThe percentage of diagnostics emitted that were expected errors held steady at 92.23%. The percentage of expected errors that received a diagnostic held steady at 87.42%. The number of fully passing files held steady at 92/134. |
Memory usage reportMemory usage unchanged ✅ |
|
| Lint rule | Added | Removed | Changed |
|---|---|---|---|
invalid-assignment |
0 | 0 | 4 |
| Total | 0 | 0 | 4 |
Raw diff:
dd-trace-py (https://github.com/DataDog/dd-trace-py)
- ddtrace/internal/module.py:301:13 error[invalid-assignment] Object of type `bound method Unknown | None.get_code(fullname) -> Unknown` is not assignable to attribute `get_code` on type `Unknown | None`
+ ddtrace/internal/module.py:301:13 error[invalid-assignment] Object of type `bound method (Unknown | None).get_code(fullname) -> Unknown` is not assignable to attribute `get_code` on type `Unknown | None`
hydra-zen (https://github.com/mit-ll-responsible-ai/hydra-zen)
- src/hydra_zen/third_party/beartype.py:125:9 error[invalid-assignment] Object of type `(bound method _T@validates_with_beartype & type.__init__() -> None) & (Overload[(o: object, /) -> None, (name: str, bases: tuple[type, ...], dict: dict[str, Any], /, **kwds: Any) -> None])` is not assignable to attribute `__init__` on type `_T@validates_with_beartype & type`
+ src/hydra_zen/third_party/beartype.py:125:9 error[invalid-assignment] Object of type `(bound method (_T@validates_with_beartype & type).__init__() -> None) & (Overload[(o: object, /) -> None, (name: str, bases: tuple[type, ...], dict: dict[str, Any], /, **kwds: Any) -> None])` is not assignable to attribute `__init__` on type `_T@validates_with_beartype & type`
psycopg (https://github.com/psycopg/psycopg)
- psycopg/psycopg/_copy.py:66:9 error[invalid-assignment] Object of type `(bound method Writer & ~AlwaysFalsy.write(data: bytes | bytearray | memoryview[int]) -> None) | (bound method LibpqWriter.write(data: bytes | bytearray | memoryview[int]) -> None)` is not assignable to attribute `_write` of type `(bound method Writer.write(data: bytes | bytearray | memoryview[int]) -> None) | (bound method LibpqWriter.write(data: bytes | bytearray | memoryview[int]) -> None)`
+ psycopg/psycopg/_copy.py:66:9 error[invalid-assignment] Object of type `(bound method (Writer & ~AlwaysFalsy).write(data: bytes | bytearray | memoryview[int]) -> None) | (bound method LibpqWriter.write(data: bytes | bytearray | memoryview[int]) -> None)` is not assignable to attribute `_write` of type `(bound method Writer.write(data: bytes | bytearray | memoryview[int]) -> None) | (bound method LibpqWriter.write(data: bytes | bytearray | memoryview[int]) -> None)`
- psycopg/psycopg/_copy_async.py:63:9 error[invalid-assignment] Object of type `(bound method AsyncWriter & ~AlwaysFalsy.write(data: bytes | bytearray | memoryview[int]) -> CoroutineType[Any, Any, None]) | (bound method AsyncLibpqWriter.write(data: bytes | bytearray | memoryview[int]) -> CoroutineType[Any, Any, None])` is not assignable to attribute `_write` of type `(bound method AsyncWriter.write(data: bytes | bytearray | memoryview[int]) -> CoroutineType[Any, Any, None]) | (bound method AsyncLibpqWriter.write(data: bytes | bytearray | memoryview[int]) -> CoroutineType[Any, Any, None])`
+ psycopg/psycopg/_copy_async.py:63:9 error[invalid-assignment] Object of type `(bound method (AsyncWriter & ~AlwaysFalsy).write(data: bytes | bytearray | memoryview[int]) -> CoroutineType[Any, Any, None]) | (bound method AsyncLibpqWriter.write(data: bytes | bytearray | memoryview[int]) -> CoroutineType[Any, Any, None])` is not assignable to attribute `_write` of type `(bound method AsyncWriter.write(data: bytes | bytearray | memoryview[int]) -> CoroutineType[Any, Any, None]) | (bound method AsyncLibpqWriter.write(data: bytes | bytearray | memoryview[int]) -> CoroutineType[Any, Any, None])`
This file contains hidden or 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
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.
Summary
This follows up on the post-merge review of #25626.
functools.partialnow preserves the full intersection receiver when delegating member lookup to its nominalpartial[T]view. Bound-method fallback still resets the receiver when lookup switches to the separate underlying function object; the implementation and regression coverage now make that distinction explicit.This also parenthesizes compound bound-method receivers in displayed types and clarifies and relocates the related intersection receiver documentation and tests.