Robert Bradshaw wrote:
> On Sep 21, 2007, at 12:58 PM, Jaap Spies wrote:

>> sage: sum(i for i in irange(1,10))
>> 55
> 
> I still think
> 
> sage: sum([1..10])
> 55
> 
> or
> 
> sage: sum(1..10)
> 55
> 
> is easier to type and understand. I can just see trying to explain to  
> half the students in a class (who got 45) "see the little 'i' in there."
> 

In one way you are right. I is easier to type. And if you are familiar
with the notation a..b, maybe you are understanding what you are doing.

But most of SAGE is still Python, so I stick to the more Pythonic alternative!

As a better name for irange I suggest now inrange, maybe that is more
intelligible:

sage: sum(i for i in inrange(1, 10))
55

Jaap


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to