Skip to content

RET501 should exempt properties #12197

@epenet

Description

@epenet

A property is normally meant to be consumed.

class Class:
    @property
    def data(self) -> None:
        return None
        # RET501 [*] Do not explicitly `return None` in function if it is the only possible return value

Based on home-assistant/core#115031

Note: the main case is when overriding base properties, so this may not be needed if #12198 is resolved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedReady for implementationhelp wantedContributions especially welcomeruleImplementing or modifying a lint rule

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions