This fixes an issue I would not expect where if you pass
Related issue number
I didn't see any.
pydantic cares about performance, if there's any risk performance changed on this PR,
The text was updated successfully, but these errors were encountered:
@@ Coverage Diff @@ ## master #264 +/- ## =========================================== - Coverage 100% 81.14% -18.86% =========================================== Files 11 11 Lines 1480 1824 +344 Branches 274 274 =========================================== Hits 1480 1480 - Misses 0 344 +344
Looks good, my only question is what happens with the following:
class MyInt(int): pass class FooModel(BaseModel): v: MyInt
I would expect it to be validated as an int. More dangerous: people could already have code like this.
Maybe safter to have:
def int_validator(v) -> int: if not isinstance(v, bool) and isinstance(v, int): return v