Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
remove automatic parenthesing in parent_to_repr_short
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrenn committed Nov 1, 2015
1 parent f0c7440 commit 0d6cce3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/sage/rings/asymptotic/growth_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -2556,7 +2556,7 @@ def __invert__(self):
sage: e2 == ~e1
True
sage: Q = GrowthGroup('x^NN'); Q
Growth Group x^((Non negative integer semiring))
Growth Group x^(Non negative integer semiring)
sage: e3 = ~Q('x'); e3
x^(-1)
sage: e3.parent()
Expand Down
10 changes: 4 additions & 6 deletions src/sage/rings/asymptotic/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,15 @@ def parent_to_repr_short(P):
sage: parent_to_repr_short(ZZ['x'])
'ZZ[x]'
sage: parent_to_repr_short(QQ['d, k'])
'(QQ[d, k])'
'QQ[d, k]'
sage: parent_to_repr_short(QQ['e'])
'QQ[e]'
sage: parent_to_repr_short(SR[['a, r']])
'(SR[[a, r]])'
'SR[[a, r]]'
sage: parent_to_repr_short(Zmod(3))
'(Ring of integers modulo 3)'
'Ring of integers modulo 3'
sage: parent_to_repr_short(Zmod(3)['g'])
'(Univariate Polynomial Ring in g over Ring of integers modulo 3)'
'Univariate Polynomial Ring in g over Ring of integers modulo 3'
"""
def abbreviate(P):
if P is sage.rings.integer_ring.ZZ:
Expand Down Expand Up @@ -147,8 +147,6 @@ def abbreviate(P):
except ValueError:
s = str(P)

if ' ' in s:
s = '(' + s + ')'
return s


Expand Down

0 comments on commit 0d6cce3

Please sign in to comment.