Skip to content

support cached_property #8913

@gibiansky

Description

@gibiansky

The functools.cached_property decorator doesn't get typechecked correctly:

from functools import cached_property
                                     
class Superclass:                    
    @property                        
    def prop(self) -> int:           
        ...                          
                                     
class Subclass(Superclass):          
    @cached_property                 
    def prop(self) -> int:           
        ...                          

mypy (version 0.770) reports:

error: Signature of "prop" incompatible with supertype "Superclass"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions