#7403: adds FiniteEnumeratedSet
---------------------------------+------------------------------------------
   Reporter:  nthiery            |       Owner:  mhansen               
       Type:  enhancement        |      Status:  needs_work            
   Priority:  major              |   Milestone:  sage-4.2.1            
  Component:  combinatorics      |    Keywords:  finite enumerated sets
Work_issues:                     |      Author:  Florent Hivert        
   Reviewer:  Nicolas M. ThiƩry  |      Merged:                        
---------------------------------+------------------------------------------
Changes (by hivert):

  * status:  positive_review => needs_work


Comment:

 Since it's not yet integrated, I take the chance to solve this stupid bug:
 {{{
 sage: FiniteEnumeratedSet([1])
 {1,}
 }}}
 I'm re-uploading a patch with the following folded in
 {{{
 diff --git a/sage/sets/finite_enumerated_set.py
 b/sage/sets/finite_enumerated_set.py
 --- a/sage/sets/finite_enumerated_set.py
 +++ b/sage/sets/finite_enumerated_set.py
 @@ -123,8 +123,13 @@ class FiniteEnumeratedSet(UniqueRepresen
              sage: S = FiniteEnumeratedSet([1,2,3])
              sage: repr(S)
              '{1, 2, 3}'
 +            sage: S = FiniteEnumeratedSet([1])
 +            sage: repr(S)
 +            '{1}'
          """
 -        return "{"+str(self._elements)[1:-1] + '}'
 +        if len(self._elements) == 1: # avoid printing '{1,}'
 +            return "{" + str(self._elements[0]) + '}'
 +        return "{" + str(self._elements)[1:-1] + '}'

      def __contains__(self, x):
          """
 }}}

 Florent

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7403#comment:3>
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to