-
Notifications
You must be signed in to change notification settings - Fork 293
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Is it possible that the below type stub is incorrect?
pydantic-core/python/pydantic_core/_pydantic_core.pyi
Lines 174 to 183 in 6a13975
def validate_assignment( | |
self, | |
obj: Any, | |
field_name: str, | |
field_value: Any, | |
*, | |
strict: bool | None = None, | |
from_attributes: bool | None = None, | |
context: 'dict[str, Any] | None' = None, | |
) -> dict[str, Any] | tuple[dict[str, Any], dict[str, Any] | None, set[str]]: |
In the below example the returned value seems to be a
of type A
.
from pydantic import BaseModel
class A(BaseModel, validate_assignment=True):
i: int
a = A(i=1)
x = a.__pydantic_validator__.validate_assignment(a, "i", 3)
print(type(x)) # <class '__main__.A'>
print(x is a) # True
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working