Skip to content

Instantly share code, notes, and snippets.

@cmutel
Created December 6, 2024 16:24
Show Gist options
  • Save cmutel/72e802d436532beace72d2a894ab49e0 to your computer and use it in GitHub Desktop.
Save cmutel/72e802d436532beace72d2a894ab49e0 to your computer and use it in GitHub Desktop.
from typing import Type
from pydantic import BaseModel
class Foo(BaseModel):
pass
class FooChild(Foo):
pass
class Bar(BaseModel):
node: Type[Foo]
Bar(node=FooChild())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment