Thanks for your inputs. Let me summarize:

ellipsis notation: gives a list of Integers

sage: [0..9]
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
sage: preparse('[0..9]')
'(ellipsis_range(Integer(0),Ellipsis,Integer(9)))'
sage: type([0..9].pop())
<type 'sage.rings.integer.Integer'>


ZZ.range: gives a list of integers

sage: ZZ.range(10)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
sage: type(ZZ.range(10).pop())
<type 'sage.rings.integer.Integer'>

interval: gives a list of ints

sage: interval(0,9)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
sage: type(interval(0,9).pop())
<type 'int'>

srange: gives a list of Integers

sage: srange(10)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
sage: type(srange(10).pop())
<type 'sage.rings.integer.Integer'>

xsrange: an interator that generates Integers.

sage: xsrange(10)
<generator object at 0x3ed2c95a8>
sage: [e for e in xsrange(10)]
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

range: gives a list of ints

sage: range(10)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
sage: type(range(10).pop())
<type 'int'>
sage: preparse('range(10)')
'range(Integer(10))'

It seems to me:

(1) ellipsis notation is easiest alternative for my purpose. 

(2) interval should be redefined to give a list of Integers. Do you agree?

(3) srange, xsrange are intended to be alternatives to range, for my 
purpose. 

(4) is this "range" the vanilla python built-in? I suspect not because 
"range" accepts Integer input. If range was redefined somewhere in sage to 
accept Integer as well as int, then perhaps range could be redefined to 
give a list of Integers for Integer input and a list of ints for int input. 
Am I wrong?  

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to