codello / Motor-ODM

A MongoDB ODM based on Motor and Pydantic.
MIT License
17 stars 5 forks source link

Mypy thinks Document class has type Any #28

Open ThibaultLemaire opened 4 years ago

ThibaultLemaire commented 4 years ago

I get the following error from mypy when trying to define a document class

Class cannot subclass 'Document' (has type 'Any')

I'm using pydantic as well, so I have the pydantic plugin installed. I don't understand why it thinks Document has type Any, from looking at the code it's just a subclass of pydantic's BaseModel ...

I've set

disallow_subclassing_any = False

for my module for now, but I don't like it. Should I write a stub file or is this an issue that can be fixed directly in Motor-ODM ?

pydantic==1.5.1
motor-odm==0.1.dev0
mypy==0.782