#14486: 0 == Set([0]) raises error
--------------------------------+-------------------------------------------
       Reporter:  vbraun        |         Owner:  jason       
           Type:  defect        |        Status:  needs_review
       Priority:  major         |     Milestone:  sage-5.10   
      Component:  misc          |    Resolution:              
       Keywords:                |   Work issues:              
Report Upstream:  N/A           |     Reviewers:              
        Authors:  Volker Braun  |     Merged in:              
   Dependencies:                |      Stopgaps:              
--------------------------------+-------------------------------------------

Comment (by ncohen):

 Oh, I see... Well, unless you see a more generic way to avoid the problem,
 could you also add floats to the list ?

 {{{
 sage: Set(float(0))
 Set of elements of 0.0
 sage: list(Set(float(0)))
 ...
 AttributeError: 'float' object has no attribute '__iter__'
 }}}

 I don't see anything else that we should avoid, but one never knows... ^^;

 Oh !

 {{{
 sage: Set(True)
 ...
 ValueError: underlying object cannot be an integer
 }}}

 What about doing it on a "whitelist" base ? Something like "if is an
 iterable we accept to build a Set from it", and otherwise we refuse ?

 Looks lke it is what `frozenset` does
 {{{
 sage: frozenset(1)
 ...
 TypeError: 'sage.rings.integer.Integer' object is not iterable
 }}}

 I'm sorry for only coming with problems and not solutions `^^;`

 Nathann

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14486#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 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 http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to