Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

concatenation of words should preserve the data type represention when possible #8233

Closed
seblabbe opened this issue Feb 10, 2010 · 9 comments

Comments

@seblabbe
Copy link
Contributor

This concerns word represented by str, tuple and list.

  1. 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'>
  1. 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'>

CC: @sagetrac-abmasse

Component: combinatorics

Keywords: word, concatenation

Author: Sébastien Labbé

Reviewer: Alexandre Blondin Massé

Merged: sage-4.3.4.alpha1

Issue created by migration from https://trac.sagemath.org/ticket/8233

@seblabbe

This comment has been minimized.

@seblabbe
Copy link
Contributor Author

Forget about this patch!

@seblabbe
Copy link
Contributor Author

Attachment: trac_8233_word_concatenation-sl.2.patch.gz

Depends on #7619.

@seblabbe
Copy link
Contributor Author

seblabbe commented Mar 1, 2010

comment:2

Attachment: trac_8233_word_concatenation-sl.patch.gz

@sagetrac-abmasse
Copy link
Mannequin

sagetrac-abmasse mannequin commented Mar 3, 2010

Reviewer: Alexandre Blondin Massé

@sagetrac-abmasse
Copy link
Mannequin

sagetrac-abmasse mannequin commented Mar 3, 2010

Changed keywords from none to word, concatenation

@sagetrac-abmasse
Copy link
Mannequin

sagetrac-abmasse mannequin commented Mar 3, 2010

comment:3

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 !

@sagetrac-abmasse
Copy link
Mannequin

sagetrac-abmasse mannequin commented Mar 3, 2010

Author: Sébastien Labbé

@mwhansen
Copy link
Contributor

mwhansen commented Mar 6, 2010

Merged: sage-4.3.4.alpha1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants