#12634: detach list of files and also be able to detach relative filenames
---------------------------------+------------------------------------------
       Reporter:  ppurka         |         Owner:  jason     
           Type:  enhancement    |        Status:  needs_work
       Priority:  minor          |     Milestone:  sage-5.1  
      Component:  misc           |    Resolution:            
       Keywords:  detach sd40.5  |   Work issues:            
Report Upstream:  N/A            |     Reviewers:            
        Authors:                 |     Merged in:            
   Dependencies:                 |      Stopgaps:            
---------------------------------+------------------------------------------
Changes (by was):

  * status:  needs_review => needs_work


Comment:

 * It says {{{"To see a list of attached files, call attached_files()"}}}.
 Technically, {{{attached_files()}}} ''is'' a list, so it doesn't make any
 sense to call it.  It would be technically correct  to write "To see a
 list of attached files, call the attached_files function" or "To see a
 list of attached files, type attached_files()."

 * This violates Python idioms:
 {{{
     if type(filename) in [list, tuple]:
 }}}
 It should be {{{if isinstance(filename, (list, tuple))}}}.

 * Instead, you could do:
 {{{
 if isinstance(filename, basestring):
     filelist = [filename]
 else:
     filelist = [str(x) for x in filename]
 }}}
 which would (a) work on any iterable (e.g., a generator expression), and
 (b) ensure that each entry in filelist is a string.

 I think this should be orthogonal to the IPython upgrade, but we'll see.

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

Reply via email to