这是indexloc提供的服务,不要输入任何密码
Skip to content

Class property without return #21403

@ashrub-holvi

Description

@ashrub-holvi

Summary

Hi,
possible linter check - method wrapped to property decorator must have at least one explicit return, possible issue is:

In [1]: class A:
   ...:     @property
   ...:     def b(self):
   ...:         "Hi"
   ...: 

In [3]: A().b is None
Out[3]: True

of course it should be covered by tests, but sometimes is not, especially if it's some special path in the code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ruleImplementing 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