Skip to content

[PY-73290] Fix missing deprecation warnings for property setters#3448

Open
unclepomedev wants to merge 1 commit intoJetBrains:masterfrom
unclepomedev:master
Open

[PY-73290] Fix missing deprecation warnings for property setters#3448
unclepomedev wants to merge 1 commit intoJetBrains:masterfrom
unclepomedev:master

Conversation

@unclepomedev
Copy link
Copy Markdown

@unclepomedev unclepomedev commented Mar 5, 2026

Fixes https://youtrack.jetbrains.com/issue/PY-73290, https://youtrack.jetbrains.com/issue/PY-57000

What this PR does:

PyDeprecationInspection now identifies assignments to properties where the corresponding setter is marked as deprecated, including those defined in type stubs (.pyi).

Implementation details:

  • Implemented visitPyTargetExpression to correctly resolve property setters and identify deprecation warnings when a property is assigned a value.
  • Explicitly resolves the class stub to retrieve the AccessDirection.WRITE property accessor, ensuring setter-only deprecations in .pyi files are accurately detected.

Testing:

  • Added test cases for both runtime-code setters and stub-backed setters in PyDeprecationTest.java.
  • Verified locally that the highlighting correctly appears and all relevant tests pass.

Screenshots:

Shows the inspection correctly highlighting an assignment to a deprecated setter in the Blender API (bpy) stubs.

Screenshot 2026-03-05 at 22 47 17

PyDeprecationInspection now identifies assignments to properties where the corresponding setter is marked as deprecated, including those defined in type stubs.
@unclepomedev unclepomedev changed the title PY-73290 Fix missing deprecation warnings for property setters [PY-73290] Fix missing deprecation warnings for property setters Mar 6, 2026
@BartvHelvert BartvHelvert added the PyCharm Pull requests for PyCharm label Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PyCharm Pull requests for PyCharm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants