KEMBAR78
Support properties with generic setters by ilevkivskyi · Pull Request #19298 · python/mypy · GitHub
Skip to content

Conversation

ilevkivskyi
Copy link
Member

This is yet another followup for checkmember work.

This handles a niche use case, but it is still used in the wild, and this restores parity between logic for descriptors with __set__() and properties with custom setters.

@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

xarray (https://github.com/pydata/xarray)
- xarray/core/variable.py: note: In member "data" of class "Variable":
- xarray/core/variable.py:442: error: Incompatible override of a setter type  [override]
- xarray/core/variable.py:442: note:  (base class "NamedArray" defined the type as "_arrayfunction[Any, Any] | _arrayapi[Any, Any]",
- xarray/core/variable.py:442: note:  override has type "T_DuckArray | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | str | _NestedSequence[complex | bytes | str]")

@ilevkivskyi ilevkivskyi merged commit 28f0600 into python:master Jun 16, 2025
19 checks passed
@ilevkivskyi ilevkivskyi deleted the tricky-setters branch June 16, 2025 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants