Why does python's range function only take numbers?
20 Nov
2005
20 Nov
'05
5:27 p.m.
I just wrote: def chrange(start, end): return [chr(i) for i in range(ord(start), ord(end)+1)] for about the thousandth time in my life. Which got me thinking. Due to the miracle of signature based polymorphism, we could make our range function take chars as well. Anybody know why CPython doesn't do this? Laura, now musing about a range function that takes an arbitrary sequence ...
6954
Age (days ago)
6955
Last active (days ago)
1 comments
2 participants
participants (2)
-
Armin Rigo
-
Laura Creighton