Skip to content

Fix Typing for cached_data_property#1620

Merged
JonnyWong16 merged 2 commits into
pushingkarmaorg:masterfrom
MineFartS:master
Jul 1, 2026
Merged

Fix Typing for cached_data_property#1620
JonnyWong16 merged 2 commits into
pushingkarmaorg:masterfrom
MineFartS:master

Conversation

@MineFartS

Copy link
Copy Markdown
Contributor

Description

All properties decorated with 'cached_data_property' were not being detected as properties. This fix forces the typing/language server to see 'cached_data_property' as 'cached_property'.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the docstring for new or existing methods
  • I have added tests when applicable

Copilot AI 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.

Pull request overview

This PR adjusts the cached_data_property decorator implementation so that type checkers/language servers treat attributes decorated with it as cached_property-like properties, improving static typing ergonomics across the PlexAPI object model.

Changes:

  • Added a __new__ override on cached_data_property to influence constructor return typing toward cached_property.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread plexapi/base.py Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@JonnyWong16

Copy link
Copy Markdown
Collaborator

Thanks.

@JonnyWong16 JonnyWong16 merged commit e0ae144 into pushingkarmaorg:master Jul 1, 2026
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.

3 participants