Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cached_property from python3.8 functools is not considered property #8103

Closed
gaborbernat opened this issue Aug 12, 2020 · 0 comments
Closed

Comments

@gaborbernat
Copy link
Contributor

gaborbernat commented Aug 12, 2020

It's because this property does not pass the check of isinstance(a, property) - see https://bugs.python.org/issue41523

https://github.com/sphinx-doc/sphinx/blob/3.x/sphinx/util/inspect.py#L305-L307 needs to change to:

from functools import cached_property

def isproperty(obj: Any) -> bool:
    """Check if the object is property."""	
    return isinstance(obj, (property, cached_property))

And guarded to be 3.8+.

@tk0miya tk0miya added this to the 3.3.0 milestone Aug 12, 2020
tk0miya added a commit that referenced this issue Sep 15, 2020
Fix #8103: autodoc: cached_property is not considered as a property
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants