Skip to content

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

Description

@sobolevn

If I have this runtime implementation:

fromabcimportabstractmethodclassA:
@abstractmethoddefsome(self) ->None:
raiseNotImplementedError

And this stub:

classA:
defsome(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