Ticket #10660 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Remove the "word:" identifier from the output of str method of word

Reported by: slabbe Owned by: slabbe
Priority: major Milestone: sage-4.7
Component: combinatorics Keywords:
Cc: tmonteil, abmasse Work issues:
Report Upstream: N/A Reviewers: Alexandre Blondin Massé
Authors: Sébastien Labbé Merged in: sage-4.7.alpha2
Dependencies: Stopgaps:

Description

Remove the "word:" identifier from the output of str method of word (and keep it only for repr).

Indeed, this is due to a bad initial design. It is now time to fix it. The "word:" identifier should be reserved for the repr method. The str method should return only the sequence of letters.

Before, the string_rep was doing that job of not printing the identifier. The problem is that things like "... %s ..." % word does not call the string_rep but the str method which includes the identifier...

This bad design is now causing problems in other modules. For instance, see ticket #10547 merged recently who changed the vertices of the De Bruijn Graph from Word type to str type. I think it is now time to fix the problem at the source (and then, put De Brujn Graph as it was before) before it creates more problems elsewhere.

Patch to be posted soon.

Attachments

trac_10660_modify_str_of_word-sl.patch Download (12.4 KB) - added by slabbe 2 years ago.

Change History

Changed 2 years ago by slabbe

comment:1 Changed 2 years ago by slabbe

  • Cc tmonteil, abmasse added
  • Status changed from new to needs_review

comment:2 Changed 2 years ago by abmasse

  • Status changed from needs_review to positive_review
  • Reviewers set to Alexandre Blondin Massé
  • Authors set to Sébastien Labbé

Hi, Sébastien!

This is something that has been bothering me for a while, I'm glad this is finally corrected! I just tested it on sage-4.6.1 with sage -testall and I get no error. The documentation builds fine. Positive review.

comment:3 Changed 2 years ago by jdemeyer

  • Milestone changed from sage-4.6.2 to sage-4.7

comment:4 Changed 2 years ago by jdemeyer

  • Status changed from positive_review to closed
  • Resolution set to fixed
  • Merged in set to sage-4.7.alpha2
Note: See TracTickets for help on using tickets.