blob: 2b78f3e96fc7f76690c8e420ba8cb3fe1688c180 [file] [log] [blame]
Miss Islington (bot)b57aeac2018-05-14 16:57:30 -07001#from __future__ import annotations
2from typing import ClassVar, Dict, get_type_hints
3from dataclasses import *
4
5class Starship:
6 stats: ClassVar[Dict[str, int]] = {}
7
8#print(get_type_hints(Starship))
9
10#class A:
11# a: Dict[int, C]
12
13#print(get_type_hints(A))
14
15cv = [ClassVar[int]]
16
17@dataclass
18class C:
19 CVS = [ClassVar[str]]
20 a: cv[0]
21 b: 'C'
22 c: 'CVS[0]'
23 x: 'ClassVar["int"]'
24 y: 'ClassVar[C]'
25
26print()
27print(C.__annotations__)
28print(C.__dataclass_fields__)
29
30
31#print(get_type_hints(C))