Closed
Description
It is possible to have type errors for django models?
class A(models.Model):
pass
class B(models.Model):
pass
def service(a: A) -> int:
pass
a_instance = A()
b_instance = B()
service(b) # no type error
It would help a lot if this could be caught earlier on the editor.
Because all models inherit from models.Model
and
Every class is also a valid type. Any instance of a subclass is also compatible with all superclasses
I' m trying to figure if there is an option to detect this errors.
Metadata
Metadata
Assignees
Labels
No labels