Skip to content

Decorators on top of @property are not supported  #14461

@analog-cbarber

Description

@analog-cbarber

We have decorators that decorate the property not the getter function,
and which must be declared BEFORE the property decorator:

@mydecorator
@property
def foo(self):
    pass

Mypy does not support this and produces the error: Decorators on top of @property are not supported

It is fine if mypy does not support this yet, but why do we have to suffer this utterly useless warning? I shouldn't have to pollute my code with comments to shut up mypy.

Instead, mypy should either simply ignore such decorators or should at least provide an option to let the user globally
shut off such "not implemented" errors.

And if you are going to produce errors like this, at least give them a "not-implemented" category instead of just using "misc".

This is the unfixed part of bug #1362.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrongtopic-descriptorsProperties, class vs. instance attributes

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions