[pypy-dev] Why does python's range function only take numbers?

Laura Creighton lac at strakt.com
Sun Nov 20 18:27:15 CET 2005


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 ...



More information about the Pypy-dev mailing list