Re: [sage-support] Sage's version of enumerate

2011-07-31 Thread Justin C. Walker
On Jul 31, 2011, at 11:00 , William Stein wrote: > On Sun, Jul 31, 2011 at 10:54 AM, Justin C. Walker wrote: >> >> On Jul 31, 2011, at 02:29 , tvn wrote: >> >>> The enumerate function in Python has the index type as 'int' instead of say >>> sage's Integer. is there an equivalent of enumerat

Re: [sage-support] Sage's version of enumerate

2011-07-31 Thread Tim Joseph Dumol
Whoops, looks like William beat me to it. On Mon, Aug 1, 2011 at 2:00 AM, Tim Joseph Dumol wrote: > While I don't think there's one readily available, you can easily define > one yourself: > > def senumerate(seq): > return ((ZZ(i), x) for (i,x) in enumerate(seq)) > > Hoep this helps. > > > O

Re: [sage-support] Sage's version of enumerate

2011-07-31 Thread Tim Joseph Dumol
While I don't think there's one readily available, you can easily define one yourself: def senumerate(seq): return ((ZZ(i), x) for (i,x) in enumerate(seq)) Hoep this helps. On Sun, Jul 31, 2011 at 5:29 PM, tvn wrote: > The enumerate function in Python has the index type as 'int' instead o

Re: [sage-support] Sage's version of enumerate

2011-07-31 Thread William Stein
On Sun, Jul 31, 2011 at 10:54 AM, Justin C. Walker wrote: > > On Jul 31, 2011, at 02:29 , tvn wrote: > >> The enumerate function in Python has the index type as 'int'  instead of say >> sage's Integer.   is there an equivalent of enumerate in Sage that returns >> Integer type ?  Thanks > > Try sra

Re: [sage-support] Sage's version of enumerate

2011-07-31 Thread Justin C. Walker
On Jul 31, 2011, at 02:29 , tvn wrote: > The enumerate function in Python has the index type as 'int' instead of say > sage's Integer. is there an equivalent of enumerate in Sage that returns > Integer type ? Thanks Try srange and sxrange/xsrange. Details with "?" HTH Justin -- Justi

[sage-support] Sage's version of enumerate

2011-07-31 Thread tvn
The enumerate function in Python has the index type as 'int' instead of say sage's Integer. is there an equivalent of enumerate in Sage that returns Integer type ? Thanks -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to s