Skip to content

Commit f9f096a

Browse files
authored
Merge pull request python#3 from cocoatomo/utils
Typing utils
2 parents 37f7456 + 00e8d2e commit f9f096a

File tree

6 files changed

+838
-827
lines changed

6 files changed

+838
-827
lines changed

third_party/3/docutils/utils/math/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
#
33
# NOTE: This dynamically typed stub was automatically generated by stubgen.
44

5-
def pick_math_environment(code, numbered: bool = ...): ...
5+
def pick_math_environment(code, numbered: bool = ...) -> str: ...

third_party/3/docutils/utils/math/latex2mathml.pyi

Lines changed: 51 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,51 @@
22
#
33
# NOTE: This dynamically typed stub was automatically generated by stubgen.
44

5-
from typing import Any, Optional
6-
7-
over: Any
8-
Greek: Any
9-
letters: Any
10-
special: Any
11-
sumintprod: Any
12-
functions: Any
13-
mathbb: Any
14-
mathscr: Any
15-
negatables: Any
5+
from docutils import nodes
6+
from typing import Any, Dict, List, Optional, Text, Tuple, Union
7+
8+
over: Dict[str, Text]
9+
Greek: Dict[str, Text]
10+
letters: Dict[str, Text]
11+
special: Dict[str, Text]
12+
sumintprod: str
13+
functions: List[str]
14+
mathbb: Dict[str, Text]
15+
mathscr: Dict[str, Text]
16+
negatables: Dict[str, Text]
1617

1718
class math:
18-
nchildren: int = ...
19-
children: Any = ...
20-
inline: Any = ...
21-
def __init__(self, children: Optional[Any] = ..., inline: Optional[Any] = ...) -> None: ...
22-
def full(self): ...
23-
def append(self, child): ...
24-
def delete_child(self): ...
25-
def close(self): ...
26-
def xml(self): ...
27-
def xml_start(self): ...
28-
def xml_end(self): ...
29-
def xml_body(self): ...
19+
nchildren: Optional[int] = ...
20+
children: Union[List[nodes.Node], nodes.Node] = ...
21+
inline: Optional[bool] = ...
22+
def __init__(self, children: Optional[Union[List[nodes.Node], nodes.Node]] = ..., inline: Optional[bool] = ...) -> None: ...
23+
def full(self) -> bool: ...
24+
def append(self, child: nodes.Node) -> nodes.Node: ...
25+
def delete_child(self) -> nodes.Node: ...
26+
def close(self) -> nodes.Node: ...
27+
def xml(self) -> List[str]: ...
28+
def xml_start(self) -> List[str]: ...
29+
def xml_end(self) -> List[str]: ...
30+
def xml_body(self) -> List[str]: ...
3031

3132
class mrow(math):
32-
def xml_start(self): ...
33+
def xml_start(self) -> List[str]: ...
3334

3435
class mtable(math):
35-
def xml_start(self): ...
36+
def xml_start(self) -> List[str]: ...
3637

3738
class mtr(mrow): ...
3839
class mtd(mrow): ...
3940

4041
class mx(math):
4142
nchildren: int = ...
42-
data: Any = ...
43-
def __init__(self, data) -> None: ...
44-
def xml_body(self): ...
43+
data: str = ...
44+
def __init__(self, data: str) -> None: ...
45+
def xml_body(self) -> List[str]: ...
4546

4647
class mo(mx):
47-
translation: Any = ...
48-
def xml_body(self): ...
48+
translation: Dict[str, str] = ...
49+
def xml_body(self) -> List[str]: ...
4950

5051
class mi(mx): ...
5152
class mn(mx): ...
@@ -67,44 +68,44 @@ class mfrac(math):
6768

6869
class msubsup(math):
6970
nchildren: int = ...
70-
reversed: Any = ...
71-
def __init__(self, children: Optional[Any] = ..., reversed: bool = ...) -> None: ...
72-
def xml(self): ...
71+
reversed: bool = ...
72+
def __init__(self, children: Optional[Union[List[nodes.Node], nodes.Node]] = ..., reversed: bool = ...) -> None: ...
73+
def xml(self) -> List[str]: ...
7374

7475
class mfenced(math):
75-
translation: Any = ...
76-
openpar: Any = ...
77-
def __init__(self, par) -> None: ...
78-
def xml_start(self): ...
76+
translation: Dict[str, Text] = ...
77+
openpar: str = ...
78+
def __init__(self, par: str) -> None: ...
79+
def xml_start(self) -> List[str]: ...
7980

8081
class mspace(math):
8182
nchildren: int = ...
8283

8384
class mstyle(math):
84-
nchildren: Any = ...
85+
nchildren: Optional[int] = ...
8586
attrs: Any = ...
86-
def __init__(self, children: Optional[Any] = ..., nchildren: Optional[Any] = ..., **kwargs) -> None: ...
87-
def xml_start(self): ...
87+
def __init__(self, children: Optional[Union[List[nodes.Node], nodes.Node]] = ..., nchildren: Optional[int] = ..., **kwargs: Any) -> None: ...
88+
def xml_start(self) -> List[str]: ...
8889

8990
class mover(math):
9091
nchildren: int = ...
91-
reversed: Any = ...
92-
def __init__(self, children: Optional[Any] = ..., reversed: bool = ...) -> None: ...
93-
def xml(self): ...
92+
reversed: bool = ...
93+
def __init__(self, children: Optional[Union[List[nodes.Node], nodes.Node]] = ..., reversed: bool = ...) -> None: ...
94+
def xml(self) -> List[str]: ...
9495

9596
class munder(math):
9697
nchildren: int = ...
9798

9899
class munderover(math):
99100
nchildren: int = ...
100-
def __init__(self, children: Optional[Any] = ...) -> None: ...
101+
def __init__(self, children: Optional[Union[List[nodes.Node], nodes.Node]] = ...) -> None: ...
101102

102103
class mtext(math):
103104
nchildren: int = ...
104-
text: Any = ...
105-
def __init__(self, text) -> None: ...
106-
def xml_body(self): ...
105+
text: str = ...
106+
def __init__(self, text: str) -> None: ...
107+
def xml_body(self) -> List[str]: ...
107108

108-
def parse_latex_math(string, inline: bool = ...): ...
109-
def handle_keyword(name, node, string): ...
110-
def tex2mathml(tex_math, inline: bool = ...): ...
109+
def parse_latex_math(string: str, inline: bool = ...) -> math: ...
110+
def handle_keyword(name: str, node: math, string: str) -> Tuple[math, int]: ...
111+
def tex2mathml(tex_math: str, inline: bool = ...) -> str: ...

0 commit comments

Comments
 (0)