Last active
August 31, 2023 19:28
-
-
Save juftin/9ee4a35a1be07ede62281df05a805f3f to your computer and use it in GitHub Desktop.
string literals
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Literal, TypedDict | |
DENSE_CALCIUM_VOLUME: Literal["denseCalciumVolume"] = "denseCalciumVolume" | |
FATTY_FIBROUS_VOLUME: Literal["fattyFibrousVolume"] = "fattyFibrousVolume" | |
TOTAL_CALCIFIED_PLAQUE_VOLUME = "totalCalcifiedPlaqueVolume" | |
class TypedCleerlyDict(TypedDict): | |
denseCalciumVolume: float | |
fattyFibrousVolume: float | |
totalCalcifiedPlaqueVolume: float | |
example: TypedCleerlyDict = { | |
"denseCalciumVolume": 0.2, | |
"fattyFibrousVolume": 1.0, | |
"totalCalcifiedPlaqueVolume": 23.2, | |
} | |
dcv: float = example[DENSE_CALCIUM_VOLUME] | |
tcpv: float = example[TOTAL_CALCIFIED_PLAQUE_VOLUME] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment