Skip to content

Commit 209598b

Browse files
authored
Remove the unused and undocumented printer.print_replace (#385)
This function's use-case appeared to be to force blades to print as bases. However, this isn't at all obvious from the name, and the arguments which can be passed in look outright dangerous. If users want to print the base representation, they can just print `some_mv.base_rep()` instead. If users want to perform arbitrary and meaningless textual substitutions, we should let them do so explicitly themselves. I suspect no one uses this function anyway.
1 parent 551837b commit 209598b

File tree

2 files changed

+0
-12
lines changed

2 files changed

+0
-12
lines changed

galgebra/mv.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,8 +659,6 @@ def _sympystr(self, print_obj: printer.GaPrinter) -> str:
659659
s += term
660660
if s[-1] == '\n':
661661
s = s[:-1]
662-
if printer.print_replace_old is not None:
663-
s = s.replace(printer.print_replace_old, printer.print_replace_new)
664662
return s
665663
else:
666664
return print_obj.doprint(self.obj)

galgebra/printer.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,12 @@
6363
\newcommand{\eval}[2]{\left . {#1} \right |_{#2}}$
6464
"""
6565

66-
print_replace_old = None
67-
print_replace_new = None
68-
6966
SYS_CMD = {'linux2': {'rm': 'rm', 'evince': 'evince', 'null': ' > /dev/null', '&': '&'},
7067
'linux': {'rm': 'rm', 'evince': 'evince', 'null': ' > /dev/null', '&': '&'},
7168
'win32': {'rm': 'del', 'evince': 'start', 'null': ' > NUL', '&': ''},
7269
'darwin': {'rm': 'rm', 'evince': 'open', 'null': ' > /dev/null', '&': '&'}}
7370

7471

75-
def print_replace(old='^', new='*'):
76-
global print_replace_old, print_replace_new
77-
print_replace_old = old
78-
print_replace_new = new
79-
return
80-
81-
8272
def isinteractive(): #Is ipython running
8373
"""
8474
We will assume that if ipython is running then jupyter notebook is

0 commit comments

Comments
 (0)