I am currently evaluating if I want to replace my own ORM solution based on pydantic models and some inheritance of base models (very simple, basically can only do crud) with FireO.
However my python language server / tooling complains basically all the time when using FireO:
class User(Model):
name = TextField()
age = NumberField()
u = User()
u.name = "Azeem"
u.age = 26
u.save()
Errors (removed filenames):
[{
"owner": "_generated_diagnostic_collection_name_#10",
"code": {
"value": "reportGeneralTypeIssues",
"target": {
"$mid": 1,
"path": "/microsoft/pyright/blob/main/docs/configuration.md",
"scheme": "https",
"authority": "github.com",
"fragment": "reportGeneralTypeIssues"
}
},
"severity": 8,
"message": "Cannot assign member \"name\" for type \"User\"\n Expression of type \"Literal['Azeem']\" cannot be assigned to member \"name\" of class \"User\"\n Member \"__set__\" is unknown\n \"Literal['Azeem']\" is incompatible with \"TextField\"",
"source": "Pylance",
"startLineNumber": 58,
"startColumn": 3,
"endLineNumber": 58,
"endColumn": 7
},{
"owner": "_generated_diagnostic_collection_name_#10",
"code": {
"value": "reportGeneralTypeIssues",
"target": {
"$mid": 1,
"path": "/microsoft/pyright/blob/main/docs/configuration.md",
"scheme": "https",
"authority": "github.com",
"fragment": "reportGeneralTypeIssues"
}
},
"severity": 8,
"message": "Cannot assign member \"age\" for type \"User\"\n Expression of type \"Literal[26]\" cannot be assigned to member \"age\" of class \"User\"\n Member \"__set__\" is unknown\n \"Literal[26]\" is incompatible with \"NumberField\"",
"source": "Pylance",
"startLineNumber": 59,
"startColumn": 3,
"endLineNumber": 59,
"endColumn": 6
}]
I also noticed that things like the .get method seem to indicate wrong types even though when I look at the code I see typevars that should be able to let the language server know the object's class when calling the funciton:

Hence my question: Am I doing something completely wrong? Is the type hinting working as expected?
I am currently evaluating if I want to replace my own ORM solution based on pydantic models and some inheritance of base models (very simple, basically can only do crud) with FireO.
However my python language server / tooling complains basically all the time when using FireO:
Errors (removed filenames):
I also noticed that things like the .get method seem to indicate wrong types even though when I look at the code I see typevars that should be able to let the language server know the object's class when calling the funciton:
Hence my question: Am I doing something completely wrong? Is the type hinting working as expected?