|
3 | 3 | """ |
4 | 4 |
|
5 | 5 | from __future__ import annotations |
6 | | -from typing import overload |
| 6 | +from typing import overload, Union |
7 | 7 |
|
8 | 8 | latex_to_bakoma = { |
9 | 9 | '\\__sqrt__' : ('cmex10', 0x70), |
|
1113 | 1113 | # Each element is a 4-tuple of the form: |
1114 | 1114 | # src_start, src_end, dst_font, dst_start |
1115 | 1115 |
|
1116 | | -_EntryTypeIn = tuple[str, str, str, str | int] |
| 1116 | +_EntryTypeIn = tuple[str, str, str, Union[str, int]] |
1117 | 1117 | _EntryTypeOut = tuple[int, int, str, int] |
1118 | 1118 |
|
1119 | | -_stix_virtual_fonts: dict[str, dict[str, list[_EntryTypeIn]] | |
1120 | | - list[_EntryTypeIn]] = { |
| 1119 | +_stix_virtual_fonts: dict[str, Union[dict[ |
| 1120 | + str, list[_EntryTypeIn]], list[_EntryTypeIn]]] = { |
1121 | 1121 | 'bb': |
1122 | 1122 | { |
1123 | 1123 | "rm": |
@@ -1744,7 +1744,8 @@ def _normalize_stix_fontcodes(d): |
1744 | 1744 | return {k: _normalize_stix_fontcodes(v) for k, v in d.items()} |
1745 | 1745 |
|
1746 | 1746 |
|
1747 | | -stix_virtual_fonts: dict[str, dict[str, list[_EntryTypeOut]] | list[_EntryTypeOut]] |
| 1747 | +stix_virtual_fonts: dict[str, Union[dict[str, list[_EntryTypeOut]], |
| 1748 | + list[_EntryTypeOut]]] |
1748 | 1749 | stix_virtual_fonts = _normalize_stix_fontcodes(_stix_virtual_fonts) |
1749 | 1750 |
|
1750 | 1751 | # Free redundant list now that it has been normalized |
|
0 commit comments