Skip to content

Commit

Permalink
Ascii product character for printing ProductSet
Browse files Browse the repository at this point in the history
Fixes sympy/sympy#10413

// edited by skirpichev
  • Loading branch information
tokencolour authored and skirpichev committed Mar 17, 2017
1 parent e539ea5 commit 7d0bb5f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion diofant/printing/pretty/pretty.py
Expand Up @@ -1334,7 +1334,7 @@ def _print_ProductSet(self, p):
if len(p.sets) > 1 and not has_variety(p.sets):
return self._print(Pow(p.sets[0], len(p.sets), evaluate=False))
else:
prod_char = "\N{MULTIPLICATION SIGN}"
prod_char = "\N{MULTIPLICATION SIGN}" if self._use_unicode else 'x'
return self._print_seq(p.sets, None, None, ' %s ' % prod_char,
parenthesize=lambda set: set.is_Union or
set.is_Intersection or set.is_ProductSet)
Expand Down
9 changes: 9 additions & 0 deletions diofant/printing/pretty/tests/test_pretty.py
Expand Up @@ -3097,6 +3097,15 @@ def test_ProductSet_paranthesis():
assert upretty(Union(a*b, b*FiniteSet(1, 2))) == ucode_str


def test_sympyissue_10413():
ascii_str = '[2, 3] x [4, 7]'
ucode_str = '[2, 3] × [4, 7]'

a, b = Interval(2, 3), Interval(4, 7)
assert pretty(a*b) == ascii_str
assert upretty(a*b) == ucode_str


def test_pretty_limits():
expr = Limit(x, x, oo)
ascii_str = \
Expand Down

0 comments on commit 7d0bb5f

Please sign in to comment.