#8289: Clean up WordMorphism.__call__
-----------------------------+----------------------------------------------
Reporter: slabbe | Owner: slabbe
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-4.3.4
Component: combinatorics | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
-----------------------------+----------------------------------------------
Comment(by abmasse):
Hello, Sébastien !
Just one question. I get the following:
{{{
sage: m = WordMorphism('a->b,b->a')
sage: m(Word())
word:
sage: m(Word(), oo)
---------------------------------------------------------------------------
IndexError Traceback (most recent call
last)
/Users/alexandre/<ipython console> in <module>()
/Users/alexandre/Applications/sage/local/lib/python2.6/site-
packages/sage/combinat/words/morphism.pyc in __call__(self, w, order,
datatype)
561 if order is Infinity:
562 if isinstance(w, (tuple,str,list,FiniteWord_class)):
--> 563 letter = w[0]
564 elif hasattr(w, '__iter__'):
565 letter = w.next()
/Users/alexandre/Applications/sage/local/lib/python2.6/site-
packages/sage/combinat/words/word_datatypes.so in
sage.combinat.words.word_datatypes.WordDatatype_list.__getitem__
(sage/combinat/words/word_datatypes.cpp:1407)()
IndexError: list index out of range
}}}
Don't you think we should get the empty word in that case ? This seems to
be well-defined.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8289#comment:5>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.