Samuel Colvin
Samuel Colvin
i think we remove magical pushdown, the only exception I still want to discuss is `Optional`. We should also remove `sub_path` (currently unused) https://github.com/pydantic/pydantic/blob/032823f9620056972415508b03c2bac76b76d2cf/pydantic/decorators.py#L211 and other places it's defined.
see https://github.com/annotated-types/annotated-types/issues/37
See https://github.com/pydantic/pydantic-core/issues/312 for similar in pydantic-core
Absolutely, have a go. You might also want to read through pydantic-core and understand how new descriminated unions work. I'll give some code examples of the final interface soon.
Interface should be as follows: ```py from typing import Literal, Union, Annotated from pydantic import BaseModel, Field from pydantic.descriminators import Tag class Cat(BaseModel): meows: int class Dog(BaseModel): barks: float class...
I don't understand, it's either a string, a list, or a function. Shouldn't matter to your logic.
Yes lots in the tests.
Yes, it's all implemented in pydantic-core. This issue, and most issues in pydantic related to V2 about about supporting the functionality in pydantic, using type hints, then updating and extending...
Great, go for it.
You're right, `__root__` is going. In that specific case, you could just replace `class Cat...` with ```py Cat = Union[BlackCat, WhiteCat] ``` and everything should work as expected. --- For...