Skip to content

Storage cannot be subclassed with mypy --disallow-any-expr #24

@pomponchik

Description

@pomponchik

With skelet==0.0.21 and mypy==1.14.1, merely subclassing Storage fails under strict Any checks.

Reproduction

Create example.py:

from skelet import Storage


class Config(Storage):
    pass

Run:

mypy --strict --disallow-any-expr example.py

Actual result:

example.py: error: Expression type contains "Any" (has type "type[Storage]")  [misc]

Expected result: a typed Storage subclass with no fields should type-check without suppressions.

reveal_type(Storage) shows the exposed constructor type includes AbstractSource[Any] and **kwargs: Any, so downstream libraries must currently disable misc merely to define configuration classes.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions