@@ -54,28 +54,36 @@ def _boxed_string(string: str, **options):
54
54
return StyleBox (String (string ), ** options )
55
55
56
56
57
- def eval_fullform_makeboxes (self , expr , evaluation , f = SymbolStandardForm ):
57
+ def eval_fullform_makeboxes (
58
+ self , expr , evaluation : Evaluation , form = SymbolStandardForm
59
+ ) -> Expression :
58
60
"""
59
61
This function takes the definitions provided by the evaluation
60
62
object, and produces a boxed form for expr.
63
+
64
+ Basically: MakeBoxes[expr // FullForm]
61
65
"""
62
66
# This is going to be reimplemented.
63
67
expr = Expression (SymbolFullForm , expr )
64
- return Expression (SymbolMakeBoxes , expr , f ).evaluate (evaluation )
68
+ return Expression (SymbolMakeBoxes , expr , form ).evaluate (evaluation )
65
69
66
70
67
- def eval_makeboxes (self , expr , evaluation , f = SymbolStandardForm ):
71
+ def eval_makeboxes (
72
+ self , expr , evaluation : Evaluation , form = SymbolStandardForm
73
+ ) -> Expression :
68
74
"""
69
75
This function takes the definitions provided by the evaluation
70
76
object, and produces a boxed fullform for expr.
77
+
78
+ Basically: MakeBoxes[expr // form]
71
79
"""
72
80
# This is going to be reimplemented.
73
- return Expression (SymbolMakeBoxes , expr , f ).evaluate (evaluation )
81
+ return Expression (SymbolMakeBoxes , expr , form ).evaluate (evaluation )
74
82
75
83
76
84
def format_element (
77
85
element : BaseElement , evaluation : Evaluation , form : Symbol , ** kwargs
78
- ) -> BaseElement :
86
+ ) -> Type [ BaseElement ] :
79
87
"""
80
88
Applies formats associated to the expression, and then calls Makeboxes
81
89
"""
@@ -95,14 +103,14 @@ def format_element(
95
103
96
104
def do_format (
97
105
element : BaseElement , evaluation : Evaluation , form : Symbol
98
- ) -> BaseElement :
106
+ ) -> Type [ BaseElement ] :
99
107
do_format_method = element_formatters .get (type (element ), do_format_element )
100
108
return do_format_method (element , evaluation , form )
101
109
102
110
103
111
def do_format_element (
104
112
element : BaseElement , evaluation : Evaluation , form : Symbol
105
- ) -> BaseElement :
113
+ ) -> Type [ BaseElement ] :
106
114
"""
107
115
Applies formats associated to the expression and removes
108
116
superfluous enclosing formats.
@@ -220,7 +228,7 @@ def format_expr(expr):
220
228
221
229
def do_format_rational (
222
230
element : BaseElement , evaluation : Evaluation , form : Symbol
223
- ) -> BaseElement :
231
+ ) -> Type [ BaseElement ] :
224
232
if form is SymbolFullForm :
225
233
return do_format_expression (
226
234
Expression (
@@ -245,7 +253,7 @@ def do_format_rational(
245
253
246
254
def do_format_complex (
247
255
element : BaseElement , evaluation : Evaluation , form : Symbol
248
- ) -> BaseElement :
256
+ ) -> Type [ BaseElement ] :
249
257
if form is SymbolFullForm :
250
258
return do_format_expression (
251
259
Expression (
@@ -273,7 +281,7 @@ def do_format_complex(
273
281
274
282
def do_format_expression (
275
283
element : BaseElement , evaluation : Evaluation , form : Symbol
276
- ) -> BaseElement :
284
+ ) -> Type [ BaseElement ] :
277
285
# # not sure how much useful is this format_cache
278
286
# if element._format_cache is None:
279
287
# element._format_cache = {}
0 commit comments