#20009: string monoid class one not defined
-------------------------------------+-------------------------------------
       Reporter:  kcrisman           |        Owner:
           Type:  enhancement        |       Status:  needs_work
       Priority:  major              |    Milestone:  sage-7.1
      Component:  algebra            |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Karan Desai        |    Reviewers:  Karl-Dieter Crisman,
Report Upstream:  N/A                |  Thierry Monteil
         Branch:                     |  Work issues:
  u/karandesai-96/string_monoid_class_one_not_defined|       Commit:
   Dependencies:                     |  4b9c7394508ba2cb83405fd2a44c05e5b650c7ab
                                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by tmonteil):

 This does not work. As such it returns the second element of the alphabet,
 as an element of the string monoid:

 {{{
 sage: b = BinaryStrings()
 sage: b.one()
 1
 sage: b.one() * b('001')
 1001

 sage: b = AlphabeticStrings()
 sage: b.one()
 B
 }}}


 What we are looking here is the neutral element for the multiplication,
 which you can get as `StringMonoidElement(self, '')`.

 You still need to add some doctests.

 Also, why creating a `_identity_element` attribute while it is used only
 once, why not directly define the identity element in the `one` method ?

--
Ticket URL: <http://trac.sagemath.org/ticket/20009#comment:9>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to