diff options
author | Eric V. Smith <ericvsmith@users.noreply.github.com> | 2018-05-14 21:16:52 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-14 21:16:52 (GMT) |
commit | 3059042410dce69806b94be72d5c8055d616f3a3 (patch) | |
tree | c5159a0e2b608d32526b74d92ea0d53f8079cf98 /x.py | |
parent | 00717a46a120dd8c8c74970fd75d201a5f42ab18 (diff) | |
download | cpython-3059042410dce69806b94be72d5c8055d616f3a3.zip cpython-3059042410dce69806b94be72d5c8055d616f3a3.tar.gz cpython-3059042410dce69806b94be72d5c8055d616f3a3.tar.bz2 |
bpo-33502: dataclass._Dataclassparams repr: use repr of each member. (GH-6812)
Diffstat (limited to 'x.py')
-rw-r--r-- | x.py | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -0,0 +1,31 @@ +#from __future__ import annotations +from typing import ClassVar, Dict, get_type_hints +from dataclasses import * + +class Starship: + stats: ClassVar[Dict[str, int]] = {} + +#print(get_type_hints(Starship)) + +#class A: +# a: Dict[int, C] + +#print(get_type_hints(A)) + +cv = [ClassVar[int]] + +@dataclass +class C: + CVS = [ClassVar[str]] + a: cv[0] + b: 'C' + c: 'CVS[0]' + x: 'ClassVar["int"]' + y: 'ClassVar[C]' + +print() +print(C.__annotations__) +print(C.__dataclass_fields__) + + +#print(get_type_hints(C)) |