Skip to content

stubtest produce no error when @abstractmethod is omitted from stubs #13322

Closed
@sobolevn

Description

@sobolevn

If I have this runtime implementation:

from abc import abstractmethod

class A:
    @abstractmethod
    def some(self) -> None:
        raise NotImplementedError

And this stub:

class A:
    def some(self) -> None: ...

There's no error.

Why is that important?
Because with the stub like above, mypy will allow to create an instance of A.
But, mypy should not be allow to do that.

I think it is a bug that should be fixed. And it is a pretty easy one.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions