#26850 closed defect (fixed)

Small fix for unicode_art of IndexedFreeModuleElement

Reported by: gh-mwageringel Owned by:
Priority: major Milestone: sage-8.5
Component: algebra Keywords: unicode_art
Cc: Merged in:
Authors: Markus Wageringel Reviewers: Frédéric Chapoton
Report Upstream: N/A Work issues:
Branch: 4969f35 (Commits) Commit: 4969f354e00217a2a55ce5811334d3dd95d8426f
Dependencies: Stopgaps:

Description

The unicode_art of IndexedFreeModuleElement incorrectly returns type str for the zero element.

sage: S = SymmetricGroupAlgebra(QQ, 3)
sage: unicode_art(S.zero())
'0'
sage: type(unicode_art(S.zero()))
<type 'str'>

As a result, building UnicodeArt expressions that have zero as subexpressions fails with an AttributeError. This can be particularly unexpected with the %display unicode_art option. Various algebras are affected by this.

sage: unicode_art([S.zero()])
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
...
AttributeError: 'str' object has no attribute 'get_breakpoints'

Change History (5)

comment:1 Changed 19 months ago by gh-mwageringel

  • Branch set to u/gh-mwageringel/indexed_element_unicode
  • Commit set to 4969f354e00217a2a55ce5811334d3dd95d8426f
  • Status changed from new to needs_review

New commits:

4969f35Fix return type of _unicode_art_ for IndexedFreeModuleElement

comment:2 Changed 19 months ago by chapoton

  • Reviewers set to Frédéric Chapoton

ok, thanks

comment:3 Changed 19 months ago by chapoton

  • Status changed from needs_review to positive_review

comment:4 Changed 19 months ago by tscrim

I have been meaning to fix this for some time. Thank you!

comment:5 Changed 19 months ago by vbraun

  • Branch changed from u/gh-mwageringel/indexed_element_unicode to 4969f354e00217a2a55ce5811334d3dd95d8426f
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.