I came across the following problem with the combination of flask_sqlalchemy
and mypy
. When I define a new ORM object like:
class Foo(db.Model):
pass
where db
is a database created using SQL Alchemy applied to flask
app, mypy
type check produces the following error:
error: Class cannot subclass 'Model' (has type 'Any')
I would like to mention that I have sqlalchemy-stubs
installed. Can someone help me with this error?