backport nerd font attribute generator to Python 3.11

This commit is contained in:
Jeffrey C. Ollie
2025-07-06 02:45:03 -05:00
parent c34bd44143
commit f7869b52fc

View File

@ -14,11 +14,10 @@ import sys
from collections import defaultdict
from contextlib import suppress
from types import SimpleNamespace
from typing import Literal, TypedDict, cast
from typing import Literal, TypedDict, cast, TypeAlias
type PatchSetAttributes = dict[Literal["default"] | int, PatchSetAttributeEntry]
type AttributeHash = tuple[str | None, str | None, str, float, float, float]
type ResolvedSymbol = PatchSetAttributes | PatchSetScaleRules | int | None
AttributeHash: TypeAlias = tuple[str | None, str | None, str, float, float, float]
class PatchSetScaleRules(TypedDict):
@ -33,6 +32,9 @@ class PatchSetAttributeEntry(TypedDict):
params: dict[str, float | bool]
PatchSetAttributes: TypeAlias = dict[Literal["default"] | int, PatchSetAttributeEntry]
ResolvedSymbol: TypeAlias = PatchSetAttributes | PatchSetScaleRules | int | None
class PatchSet(TypedDict):
SymStart: int
SymEnd: int