Skip to content

(🐞) error when there are defs between overloads/properties #12546

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

Closed
KotlinIsland opened this issue Apr 8, 2022 · 1 comment
Closed

(🐞) error when there are defs between overloads/properties #12546

KotlinIsland opened this issue Apr 8, 2022 · 1 comment
Labels
bug mypy got something wrong

Comments

@KotlinIsland
Copy link
Contributor

from typing import overload
class A:
    @property
    def foo(self) -> bool: ...
    a: int
    @foo.setter # error: Name "foo" already defined on line 3 # error: "Callable[[A], bool]" has no attribute "setter"
    def foo(self, value) -> None: ...
    
    @overload # error: Single overload definition, multiple required
    def bar(self, i: int) -> int: ...
    b: int  
    @overload # error: Name "bar" already defined on line 9 # error: Single overload definition, multiple required
    def bar(self, i: str) -> str: ...

    def bar(self, i: object) -> object: ...

stubgen can insert attribute definitions between the property defs

@KotlinIsland KotlinIsland added the bug mypy got something wrong label Apr 8, 2022
@AlexWaygood
Copy link
Member

Duplicate of #1465 (for properties) and #10120 (for overloads)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

No branches or pull requests

2 participants