Skip to content

stubgen seems not able to handle a property deleter #16690

Closed
@ktns

Description

@ktns

Bug Report

When I feed stubgen with a class with a deleter method of a property, it seems to ignore the decorator.

To Reproduce

class Foo:
    @property
    def bar(self)->int:
        return 42

    @bar.setter
    def bar(self, int) -> None:
        pass

    @bar.deleter
    def bar(self) -> None:
        pass

Expected Behavior

class Foo:
    @property
    def bar(self) -> int: ...
    @bar.setter
    def bar(self, int) -> None: ...
    @bar.deleter
    def bar(self) -> None: ...

Actual Behavior

class Foo:
    @property
    def bar(self) -> int: ...
    @bar.setter
    def bar(self, int) -> None: ...
    def bar(self) -> None: ...

Your Environment

  • Mypy version used: 1.7.1
  • Mypy command-line flags: stubgen test.py
  • Mypy configuration options from mypy.ini (and other config files): n/a
  • Python version used: 3.11

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions