xrange not hashable - why not?

"Martin v. Löwis" martin at v.loewis.de
Mon Jan 26 01:11:58 EST 2004


Hans Nowak wrote:

> (C:\) $ python22
> Python 2.2.2 (#37, Oct 14 2002, 17:02:34) [MSC 32 bit (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
>  >>> hash(xrange)
> 503376880

You shouldn't hash the xrange function, but instance of the xrange type.

Regards,
Martin




More information about the Python-list mailing list