kc0506
kc0506
How does typescript determine which of `x` and `tail` should take up the rest characters? For example, if `S` is `'abc'`, why are `x='a'` and `tail='bc'`, not `x='ab'` and `tail='c`?...
@dmontagu Thanks for the review! I made some changes, so now this can work: ```py class A(BaseModel, Generic[T1]): ... class B1(A[T1], Generic[T1, T2]): ... assert A[int] in B1[T1, str][int].__mro__ assert...
@dmontagu I found that my current solution cannot handle this (very unlikely) case: ```py class A(BaseModel, Generic[T1]): ... class B(A[T2], Generic[T2]): ... class C(B[T3], Generic[T3]): ... class D(C[T1], Generic[T1]): ......
> @kc0506, if you're able to finish this up in the next couple of days, we can get this into our v2.9 release! Thanks for your awesome work here. Sure,...
I've updated the logic insdie `mro`. The new approach does not need an extra class variable and can solve the failed case mentioned above, as well as remove redundant bases...
I've updated both the json and python schemas with some notable changes: For json schema, Non-primitive types are now considered hashable: - lists are validated as tuple. - objects are...
The bug can be reproduced with the following code: ```python class M1(BaseModel, Generic[X]): bar: M1[X] class M2(M1[str]): # KeyError pass ``` However, if you explicitly define `bar`, the error goes...
I think I might have misphrased my question a bit. I am trying to **contribute** to `pydantic_core` (i.e. with Rust code), and the logic I would like to add is...
Note that most approaches I mentioned cannot apply to nested `Self` usage such as ```py class A: def f(): def g(self: Self): ... ``` To my understanding, such cases are...
So what I was thinking is we can utilize `validate_call` along with [typeshed](https://github.com/python/typeshed/blob/main/stdlib/builtins.pyi) to reduce the maintenance burden, so that we barely need to write annotations/schemas by hand. Take `list`...