|
| 1 | +diff --git a/sympy/printing/pretty/pretty.py b/sympy/printing/pretty/pretty.py |
| 2 | +index 604e97c..ddd3eb2 100644 |
| 3 | +--- a/sympy/printing/pretty/pretty.py |
| 4 | ++++ b/sympy/printing/pretty/pretty.py |
| 5 | +@@ -166,14 +166,14 @@ class PrettyPrinter(Printer): |
| 6 | + arg = e.args[0] |
| 7 | + pform = self._print(arg) |
| 8 | + if isinstance(arg, Equivalent): |
| 9 | +- return self._print_Equivalent(arg, altchar=u"\N{NOT IDENTICAL TO}") |
| 10 | ++ return self._print_Equivalent(arg, altchar=u"NOT IDENTICAL TO") |
| 11 | + if isinstance(arg, Implies): |
| 12 | +- return self._print_Implies(arg, altchar=u"\N{RIGHTWARDS ARROW WITH STROKE}") |
| 13 | ++ return self._print_Implies(arg, altchar=u"RIGHTWARDS ARROW WITH STROKE") |
| 14 | + |
| 15 | + if arg.is_Boolean and not arg.is_Not: |
| 16 | + pform = prettyForm(*pform.parens()) |
| 17 | + |
| 18 | +- return prettyForm(*pform.left(u"\N{NOT SIGN}")) |
| 19 | ++ return prettyForm(*pform.left(u"NOT SIGN")) |
| 20 | + else: |
| 21 | + return self._print_Function(e) |
| 22 | + |
| 23 | +@@ -200,43 +200,43 @@ class PrettyPrinter(Printer): |
| 24 | + |
| 25 | + def _print_And(self, e): |
| 26 | + if self._use_unicode: |
| 27 | +- return self.__print_Boolean(e, u"\N{LOGICAL AND}") |
| 28 | ++ return self.__print_Boolean(e, u"LOGICAL AND") |
| 29 | + else: |
| 30 | + return self._print_Function(e, sort=True) |
| 31 | + |
| 32 | + def _print_Or(self, e): |
| 33 | + if self._use_unicode: |
| 34 | +- return self.__print_Boolean(e, u"\N{LOGICAL OR}") |
| 35 | ++ return self.__print_Boolean(e, u"LOGICAL OR") |
| 36 | + else: |
| 37 | + return self._print_Function(e, sort=True) |
| 38 | + |
| 39 | + def _print_Xor(self, e): |
| 40 | + if self._use_unicode: |
| 41 | +- return self.__print_Boolean(e, u"\N{XOR}") |
| 42 | ++ return self.__print_Boolean(e, u"XOR") |
| 43 | + else: |
| 44 | + return self._print_Function(e, sort=True) |
| 45 | + |
| 46 | + def _print_Nand(self, e): |
| 47 | + if self._use_unicode: |
| 48 | +- return self.__print_Boolean(e, u"\N{NAND}") |
| 49 | ++ return self.__print_Boolean(e, u"NAND") |
| 50 | + else: |
| 51 | + return self._print_Function(e, sort=True) |
| 52 | + |
| 53 | + def _print_Nor(self, e): |
| 54 | + if self._use_unicode: |
| 55 | +- return self.__print_Boolean(e, u"\N{NOR}") |
| 56 | ++ return self.__print_Boolean(e, u"NOR") |
| 57 | + else: |
| 58 | + return self._print_Function(e, sort=True) |
| 59 | + |
| 60 | + def _print_Implies(self, e, altchar=None): |
| 61 | + if self._use_unicode: |
| 62 | +- return self.__print_Boolean(e, altchar or u"\N{RIGHTWARDS ARROW}", sort=False) |
| 63 | ++ return self.__print_Boolean(e, altchar or u"RIGHTWARDS ARROW", sort=False) |
| 64 | + else: |
| 65 | + return self._print_Function(e) |
| 66 | + |
| 67 | + def _print_Equivalent(self, e, altchar=None): |
| 68 | + if self._use_unicode: |
| 69 | +- return self.__print_Boolean(e, altchar or u"\N{IDENTICAL TO}") |
| 70 | ++ return self.__print_Boolean(e, altchar or u"IDENTICAL TO") |
| 71 | + else: |
| 72 | + return self._print_Function(e, sort=True) |
| 73 | + |
| 74 | +@@ -425,7 +425,7 @@ class PrettyPrinter(Printer): |
| 75 | + if self._use_unicode: |
| 76 | + # use unicode corners |
| 77 | + horizontal_chr = xobj('-', 1) |
| 78 | +- corner_chr = u'\N{BOX DRAWINGS LIGHT DOWN AND HORIZONTAL}' |
| 79 | ++ corner_chr = u'BOX DRAWINGS LIGHT DOWN AND HORIZONTAL' |
| 80 | + |
| 81 | + func_height = pretty_func.height() |
| 82 | + |
| 83 | +@@ -580,7 +580,7 @@ class PrettyPrinter(Printer): |
| 84 | + |
| 85 | + LimArg = self._print(z) |
| 86 | + if self._use_unicode: |
| 87 | +- LimArg = prettyForm(*LimArg.right(u'\N{BOX DRAWINGS LIGHT HORIZONTAL}\N{RIGHTWARDS ARROW}')) |
| 88 | ++ LimArg = prettyForm(*LimArg.right(u'BOX DRAWINGS LIGHT HORIZONTALRIGHTWARDS ARROW')) |
| 89 | + else: |
| 90 | + LimArg = prettyForm(*LimArg.right('->')) |
| 91 | + LimArg = prettyForm(*LimArg.right(self._print(z0))) |
| 92 | +@@ -589,7 +589,7 @@ class PrettyPrinter(Printer): |
| 93 | + dir = "" |
| 94 | + else: |
| 95 | + if self._use_unicode: |
| 96 | +- dir = u'\N{SUPERSCRIPT PLUS SIGN}' if str(dir) == "+" else u'\N{SUPERSCRIPT MINUS}' |
| 97 | ++ dir = u'SUPERSCRIPT PLUS SIGN' if str(dir) == "+" else u'SUPERSCRIPT MINUS' |
| 98 | + |
| 99 | + LimArg = prettyForm(*LimArg.right(self._print(dir))) |
| 100 | + |
| 101 | +@@ -740,7 +740,7 @@ class PrettyPrinter(Printer): |
| 102 | + def _print_Adjoint(self, expr): |
| 103 | + pform = self._print(expr.arg) |
| 104 | + if self._use_unicode: |
| 105 | +- dag = prettyForm(u'\N{DAGGER}') |
| 106 | ++ dag = prettyForm(u'DAGGER') |
| 107 | + else: |
| 108 | + dag = prettyForm('+') |
| 109 | + from sympy.matrices import MatrixSymbol |
| 110 | +@@ -850,8 +850,8 @@ class PrettyPrinter(Printer): |
| 111 | + if '\n' in partstr: |
| 112 | + tempstr = partstr |
| 113 | + tempstr = tempstr.replace(vectstrs[i], '') |
| 114 | +- tempstr = tempstr.replace(u'\N{RIGHT PARENTHESIS UPPER HOOK}', |
| 115 | +- u'\N{RIGHT PARENTHESIS UPPER HOOK}' |
| 116 | ++ tempstr = tempstr.replace(u'RIGHT PARENTHESIS UPPER HOOK', |
| 117 | ++ u'RIGHT PARENTHESIS UPPER HOOK' |
| 118 | + + ' ' + vectstrs[i]) |
| 119 | + o1[i] = tempstr |
| 120 | + o1 = [x.split('\n') for x in o1] |
| 121 | +@@ -1153,7 +1153,7 @@ class PrettyPrinter(Printer): |
| 122 | + def _print_Lambda(self, e): |
| 123 | + vars, expr = e.args |
| 124 | + if self._use_unicode: |
| 125 | +- arrow = u" \N{RIGHTWARDS ARROW FROM BAR} " |
| 126 | ++ arrow = u" RIGHTWARDS ARROW FROM BAR " |
| 127 | + else: |
| 128 | + arrow = " -> " |
| 129 | + if len(vars) == 1: |
| 130 | +@@ -1173,7 +1173,7 @@ class PrettyPrinter(Printer): |
| 131 | + elif len(expr.variables): |
| 132 | + pform = prettyForm(*pform.right(self._print(expr.variables[0]))) |
| 133 | + if self._use_unicode: |
| 134 | +- pform = prettyForm(*pform.right(u" \N{RIGHTWARDS ARROW} ")) |
| 135 | ++ pform = prettyForm(*pform.right(u" RIGHTWARDS ARROW ")) |
| 136 | + else: |
| 137 | + pform = prettyForm(*pform.right(" -> ")) |
| 138 | + if len(expr.point) > 1: |
| 139 | +@@ -1462,7 +1462,7 @@ class PrettyPrinter(Printer): |
| 140 | + and expt is S.Half and bpretty.height() == 1 |
| 141 | + and (bpretty.width() == 1 |
| 142 | + or (base.is_Integer and base.is_nonnegative))): |
| 143 | +- return prettyForm(*bpretty.left(u'\N{SQUARE ROOT}')) |
| 144 | ++ return prettyForm(*bpretty.left(u'SQUARE ROOT')) |
| 145 | + |
| 146 | + # Construct root sign, start with the \/ shape |
| 147 | + _zZ = xobj('/', 1) |
| 148 | +@@ -1558,7 +1558,7 @@ class PrettyPrinter(Printer): |
| 149 | + from sympy import Pow |
| 150 | + return self._print(Pow(p.sets[0], len(p.sets), evaluate=False)) |
| 151 | + else: |
| 152 | +- prod_char = u"\N{MULTIPLICATION SIGN}" if self._use_unicode else 'x' |
| 153 | ++ prod_char = u"MULTIPLICATION SIGN" if self._use_unicode else 'x' |
| 154 | + return self._print_seq(p.sets, None, None, ' %s ' % prod_char, |
| 155 | + parenthesize=lambda set: set.is_Union or |
| 156 | + set.is_Intersection or set.is_ProductSet) |
| 157 | +@@ -1570,7 +1570,7 @@ class PrettyPrinter(Printer): |
| 158 | + def _print_Range(self, s): |
| 159 | + |
| 160 | + if self._use_unicode: |
| 161 | +- dots = u"\N{HORIZONTAL ELLIPSIS}" |
| 162 | ++ dots = u"HORIZONTAL ELLIPSIS" |
| 163 | + else: |
| 164 | + dots = '...' |
| 165 | + |
| 166 | +@@ -1641,7 +1641,7 @@ class PrettyPrinter(Printer): |
| 167 | + |
| 168 | + def _print_ImageSet(self, ts): |
| 169 | + if self._use_unicode: |
| 170 | +- inn = u"\N{SMALL ELEMENT OF}" |
| 171 | ++ inn = u"SMALL ELEMENT OF" |
| 172 | + else: |
| 173 | + inn = 'in' |
| 174 | + variables = self._print_seq(ts.lamda.variables) |
| 175 | +@@ -1653,10 +1653,10 @@ class PrettyPrinter(Printer): |
| 176 | + |
| 177 | + def _print_ConditionSet(self, ts): |
| 178 | + if self._use_unicode: |
| 179 | +- inn = u"\N{SMALL ELEMENT OF}" |
| 180 | ++ inn = u"SMALL ELEMENT OF" |
| 181 | + # using _and because and is a keyword and it is bad practice to |
| 182 | + # overwrite them |
| 183 | +- _and = u"\N{LOGICAL AND}" |
| 184 | ++ _and = u"LOGICAL AND" |
| 185 | + else: |
| 186 | + inn = 'in' |
| 187 | + _and = 'and' |
| 188 | +@@ -1677,7 +1677,7 @@ class PrettyPrinter(Printer): |
| 189 | + |
| 190 | + def _print_ComplexRegion(self, ts): |
| 191 | + if self._use_unicode: |
| 192 | +- inn = u"\N{SMALL ELEMENT OF}" |
| 193 | ++ inn = u"SMALL ELEMENT OF" |
| 194 | + else: |
| 195 | + inn = 'in' |
| 196 | + variables = self._print_seq(ts.variables) |
| 197 | +@@ -1690,7 +1690,7 @@ class PrettyPrinter(Printer): |
| 198 | + def _print_Contains(self, e): |
| 199 | + var, set = e.args |
| 200 | + if self._use_unicode: |
| 201 | +- el = u" \N{ELEMENT OF} " |
| 202 | ++ el = u" ELEMENT OF " |
| 203 | + return prettyForm(*stringPict.next(self._print(var), |
| 204 | + el, self._print(set)), binding=8) |
| 205 | + else: |
| 206 | +@@ -1698,7 +1698,7 @@ class PrettyPrinter(Printer): |
| 207 | + |
| 208 | + def _print_FourierSeries(self, s): |
| 209 | + if self._use_unicode: |
| 210 | +- dots = u"\N{HORIZONTAL ELLIPSIS}" |
| 211 | ++ dots = u"HORIZONTAL ELLIPSIS" |
| 212 | + else: |
| 213 | + dots = '...' |
| 214 | + return self._print_Add(s.truncate()) + self._print(dots) |
| 215 | +@@ -1708,7 +1708,7 @@ class PrettyPrinter(Printer): |
| 216 | + |
| 217 | + def _print_SeqFormula(self, s): |
| 218 | + if self._use_unicode: |
| 219 | +- dots = u"\N{HORIZONTAL ELLIPSIS}" |
| 220 | ++ dots = u"HORIZONTAL ELLIPSIS" |
| 221 | + else: |
| 222 | + dots = '...' |
| 223 | + |
0 commit comments