Skip to content

Instantly share code, notes, and snippets.

@arnauorriols
Created July 17, 2018 21:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arnauorriols/7dc574355bf5f43bd3a66b3d648467e2 to your computer and use it in GitHub Desktop.
Save arnauorriols/7dc574355bf5f43bd3a66b3d648467e2 to your computer and use it in GitHub Desktop.
from typing import NamedTuple
from mypy_extensions import TypedDict
A = TypedDict("A", { # error: Recursive types not fully supported yet, nested types replaced with "Any"
"b": B,
"c": C
})
B = TypedDict("B", {
"c": C
})
C = TypedDict("C", {
"name": str
})
class An(NamedTuple): # error: Recursive types not fully supported yet, nested types replaced with "Any"
b: Bn
c: Cn
class Bn(NamedTuple):
c: Cn
class Cn(NamedTuple):
name: str
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment