Describe the bug
In the latest version if I use underscored attributes, which are private attributes, when I try to use them like self._private_attr
, the IDE shows Unresolved attribute reference
error.
The same if I use PrivateAttr(default)
.
To Reproduce
class Test(BaseModel):
_private_attr: int = 42
def get(self):
print(self._private_attr) # Unresolved attribute reference '_private_attr' for class 'Test'
@classmethod
def test(cls):
print(cls._private_attr.defaut) # Unresolved attribute reference 'default' for class 'int'
Expected behavior
It shoud not show errors.
Environments (please complete the following information):
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too