Why does python's range function only take numbers?

Nov. 20, 2005
9:27 a.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 ...
7174
Age (days ago)
7175
Last active (days ago)
1 comments
2 participants
participants (2)
-
Armin Rigo
-
Laura Creighton