File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change 3
3
"""
4
4
from __future__ import annotations
5
5
6
- import sys
6
+ import collections . abc as abc
7
7
import itertools
8
+ import sys
8
9
import typing
9
- import collections .abc as abc
10
10
11
- from typing import Literal , Optional , Sequence
11
+ from textwrap import indent
12
+ from dataclasses import dataclass
13
+ from typing import Literal , Optional , Sequence , Union
12
14
if sys .version_info >= (3 , 10 ):
13
15
from typing import TypeAlias
14
16
else :
15
17
TypeAlias = "TypeAlias"
16
18
17
- from textwrap import indent
18
- from dataclasses import dataclass
19
-
20
19
from quartodoc .pandoc .components import Attr
21
20
from quartodoc .pandoc .inlines import (
22
21
Inline ,
@@ -83,8 +82,8 @@ def as_list_item(self):
83
82
84
83
# TypeAlias declared here to avoid forward-references which
85
84
# break beartype
86
- ContentItem : TypeAlias = str | Inline | Block
87
- BlockContent : TypeAlias = ContentItem | Sequence [ContentItem ]
85
+ ContentItem : TypeAlias = Union [ str , Inline , Block ]
86
+ BlockContent : TypeAlias = Union [ ContentItem , Sequence [ContentItem ] ]
88
87
DefinitionItem : TypeAlias = tuple [InlineContent , BlockContent ]
89
88
90
89
Original file line number Diff line number Diff line change 8
8
9
9
from dataclasses import dataclass
10
10
from pathlib import Path
11
- from typing import Optional , Sequence
11
+ from typing import Optional , Sequence , Union
12
12
if sys .version_info >= (3 , 10 ):
13
13
from typing import TypeAlias
14
14
else :
@@ -66,7 +66,7 @@ def as_list_item(self):
66
66
67
67
# TypeAlias declared here to avoid forward-references which
68
68
# break beartype
69
- InlineContent : TypeAlias = str | Inline | Sequence [str | Inline ]
69
+ InlineContent : TypeAlias = Union [ str , Inline , Union [ Sequence [str ], Inline ] ]
70
70
71
71
72
72
@dataclass
You can’t perform that action at this time.
0 commit comments