Opened 12 years ago
Closed 12 years ago
#8233 closed enhancement (fixed)
concatenation of words should preserve the data type represention when possible
Reported by: | slabbe | Owned by: | sage-combinat |
---|---|---|---|
Priority: | major | Milestone: | sage-4.3.4 |
Component: | combinatorics | Keywords: | word, concatenation |
Cc: | abmasse | Merged in: | sage-4.3.4.alpha1 |
Authors: | Sébastien Labbé | Reviewers: | Alexandre Blondin Massé |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
This concerns word represented by str, tuple and list.
- We want the representation of a concatenation of two words u and v to be preserved when u and v are of the same data type.
ACTUAL BEHAVIOR:
sage: u = Word(range(10)) sage: type(u) <class 'sage.combinat.words.word.FiniteWord_list'> sage: type(u*u) <class 'sage.combinat.words.word.FiniteWord_callable_with_caching'>
sage: v = Word('asdgadsf') sage: type(v) <class 'sage.combinat.words.word.FiniteWord_str'> sage: type(v*v) <class 'sage.combinat.words.word.FiniteWord_callable_with_caching'>
sage: v = Word((2,3,5,21,34,6)) sage: type(v) <class 'sage.combinat.words.word.FiniteWord_tuple'> sage: type(v*v) <class 'sage.combinat.words.word.FiniteWord_callable_with_caching'>
- Moreover, the empty word could be ignored for concatenation :
ACTUAL BEHAVIOR:
sage: type(Word([]) * Word('asdga')) <class 'sage.combinat.words.word.FiniteWord_callable_with_caching'>
INTENDED BEHAVIOR:
sage: type(Word([]) * Word('asdga')) <class 'sage.combinat.words.word.FiniteWord_str'>
Attachments (2)
Change History (6)
comment:1 Changed 12 years ago by
- Description modified (diff)
- Status changed from new to needs_review
Changed 12 years ago by
comment:2 Changed 12 years ago by
- Cc abmasse added
comment:3 Changed 12 years ago by
- Keywords word concatenation added
- Reviewers set to Alexandre Blondin Massé
- Status changed from needs_review to positive_review
Tested on sage-4.3.3 after having applied ticket #7619. All tests passed, looking at the documentation with browse_sage_doc
reveals nothing to be corrected. The improvement seems very reasonable and the code looks fine. Positive review !
comment:4 Changed 12 years ago by
- Merged in set to sage-4.3.4.alpha1
- Resolution set to fixed
- Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
Forget about this patch!