Describe the Bug
from pydantic import BaseModel
class Foo(BaseModel):
a: int
_a: int
def initialize(self):
self._a = 1
foo = Foo(a=1) # error: Missing argument `_a` in function `Foo.__init__` [missing-argument]
in pydantic, an attribute prefixed with _ is not considered a field. this code works at runtime
Sandbox Link
No response
(Only applicable for extension issues) IDE Information
No response
Describe the Bug
in pydantic, an attribute prefixed with
_is not considered a field. this code works at runtimeSandbox Link
No response
(Only applicable for extension issues) IDE Information
No response