Skip to content

Commit f4abe20

Browse files
devRDksunden
andcommitted
Add Union for multiple type info
Co-authored-by: Kyle Sunden <git@ksunden.space>
1 parent 05035ba commit f4abe20

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/matplotlib/_mathtext_data.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44

55
from __future__ import annotations
6-
from typing import overload
6+
from typing import overload, Union
77

88
latex_to_bakoma = {
99
'\\__sqrt__' : ('cmex10', 0x70),
@@ -1113,11 +1113,11 @@
11131113
# Each element is a 4-tuple of the form:
11141114
# src_start, src_end, dst_font, dst_start
11151115

1116-
_EntryTypeIn = tuple[str, str, str, str | int]
1116+
_EntryTypeIn = tuple[str, str, str, Union[str, int]]
11171117
_EntryTypeOut = tuple[int, int, str, int]
11181118

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]]] = {
11211121
'bb':
11221122
{
11231123
"rm":
@@ -1744,7 +1744,8 @@ def _normalize_stix_fontcodes(d):
17441744
return {k: _normalize_stix_fontcodes(v) for k, v in d.items()}
17451745

17461746

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]]]
17481749
stix_virtual_fonts = _normalize_stix_fontcodes(_stix_virtual_fonts)
17491750

17501751
# Free redundant list now that it has been normalized

0 commit comments

Comments
 (0)