Ticket #10660 (closed defect: fixed)
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
Change History
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.

