Skip to content

Commit 556b814

Browse files
committed
Make explicit the fact that the behavior of Fmt depends on latex_flg.
This is not a behavior change. By inlining `__str__` into `Fmt`, it becomes clear that the logic is wrong for keeping track of `fmt` and `prev_fmt`. This will be addressed in a future commit.
1 parent 4148098 commit 556b814

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

galgebra/mv.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,11 @@ def Fmt(self, fmt=1, title=None):
11721172
if printer.isinteractive():
11731173
return self
11741174

1175-
s = str(self)
1175+
if printer.GaLatexPrinter.latex_flg:
1176+
s = printer.GaLatexPrinter().doprint(self)
1177+
else:
1178+
s = printer.GaPrinter().doprint(self)
1179+
11761180
printer.GaPrinter.fmt = printer.GaPrinter.prev_fmt
11771181
if title is not None:
11781182
return title + ' = ' + s
@@ -1804,7 +1808,11 @@ def Fmt(self, fmt=1, title=None, dop_fmt=None):
18041808
if printer.isinteractive():
18051809
return self
18061810

1807-
s = str(self)
1811+
if printer.GaLatexPrinter.latex_flg:
1812+
s = printer.GaLatexPrinter().doprint(self)
1813+
else:
1814+
s = printer.GaPrinter().doprint(self)
1815+
18081816
printer.GaPrinter.fmt = printer.GaPrinter.prev_fmt
18091817
printer.GaPrinter.dop_fmt = printer.GaPrinter.prev_dop_fmt
18101818

0 commit comments

Comments
 (0)