Newbie: Large dictionaries

Carsten Gaebler cg at schlund.de
Fri Feb 23 04:29:44 EST 2001


Mikkel Rasmussen wrote:
> 
> Why can't there be more than about 65.000 entries in a dictionary, or more
> importantly: how can I make a large dictionary with room for at least
> 500.000
> elements?

Don't know where your problem is:

#!/usr/bin/python

d = {}
for i in xrange(100000):
	d[i] = i

for (k, v) in d.items():
	print k, v



cg.



More information about the Python-list mailing list