Any way to use a range as a key in a dictionary?

Paul Rubin http
Thu Mar 26 23:13:53 CET 2009

Mudcat <mnations at> writes:
> However I wondered if there was a way to simply use a range as a key
> reference somehow. 

Dictionaries aren't really the right structure for that.  You want a
tree or binary search structure of some sort.  The bisect module might
be helpful, but you will have to write some code by hand if you use

More information about the Python-list mailing list