Skip to content

[ty] Address intersection receiver review feedback#25819

Merged
charliermarsh merged 1 commit into
mainfrom
charlie/address-intersection-receiver-review
Jun 10, 2026
Merged

[ty] Address intersection receiver review feedback#25819
charliermarsh merged 1 commit into
mainfrom
charlie/address-intersection-receiver-review

Conversation

@charliermarsh

Copy link
Copy Markdown
Member

Summary

This follows up on the post-merge review of #25626.

functools.partial now preserves the full intersection receiver when delegating member lookup to its nominal partial[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.

@astral-sh-bot astral-sh-bot Bot added the ty Multi-file analysis & type inference label Jun 10, 2026
@charliermarsh charliermarsh marked this pull request as ready for review June 10, 2026 13:21
@astral-sh-bot

astral-sh-bot Bot commented Jun 10, 2026

Copy link
Copy Markdown

Typing conformance results

No changes detected ✅

Current numbers
The 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.

@astral-sh-bot

astral-sh-bot Bot commented Jun 10, 2026

Copy link
Copy Markdown

Memory usage report

Memory usage unchanged ✅

@astral-sh-bot

astral-sh-bot Bot commented Jun 10, 2026

Copy link
Copy Markdown

ecosystem-analyzer results

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])`

Full report with detailed diff (timing results)

@AlexWaygood AlexWaygood removed their request for review June 10, 2026 13:26

@sharkdp sharkdp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much!

@charliermarsh charliermarsh merged commit 13e4a58 into main Jun 10, 2026
59 checks passed
@charliermarsh charliermarsh deleted the charlie/address-intersection-receiver-review branch June 10, 2026 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants