Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stubgen seems not able to handle a property deleter #16690

Closed
ktns opened this issue Dec 21, 2023 · 0 comments · Fixed by #16781
Closed

stubgen seems not able to handle a property deleter #16690

ktns opened this issue Dec 21, 2023 · 0 comments · Fixed by #16781
Labels
bug mypy got something wrong topic-stubgen

Comments

@ktns
Copy link

ktns commented Dec 21, 2023

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong topic-stubgen
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants