#12247: var(['x','y']) should work but doesn't
---------------------------+------------------------------------------------
   Reporter:  was          |          Owner:  burcin      
       Type:  enhancement  |         Status:  needs_review
   Priority:  minor        |      Milestone:  sage-5.0    
  Component:  symbolics    |       Keywords:              
Work_issues:               |       Upstream:  N/A         
   Reviewer:               |         Author:  Volker Braun
     Merged:               |   Dependencies:              
---------------------------+------------------------------------------------

Comment(by nbruin):

 The pythonic thing would be to realize that the important part of the list
 here is that it is an iterable and hence accepting an iterable might be
 the right thing to do. But since strings are iterable too, this doesn't
 work.

 So either lists or strings would need to be special cased. This breaks
 subclassing (if someone writes a class that is supposed to mimic strings
 or lists, how do you tell which is which? isinstance doesn't work on
 builtins, and multiple inheritance would mean you would not necessarily be
 able to decide based on that anyway. Look in the mro which of list or str
 you meet first?)

 Perhaps safer is to accept var('x','y') and hence also var(*['x','y']).

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