Newbie: Large dictionaries

Mikkel Rasmussen footech at get2net.dk
Fri Feb 23 07:52:58 EST 2001


>
> >>> count = 0
> >>> for elem in dict:
> ...     count = count + 1
> ...
> Traceback (innermost last):
>   File "<stdin>", line 1, in ?
> TypeError: loop over non-sequence
>
> are you sure you're using Python?
>
> > The keys are ordinary words like an ordinary dictionary :-) with an
average
> > length of about 6 characters.
>
> and what language has four million *unique* words
> having six characters and less?
>
> Cheers /F
>
>
Yes, I know you can't loop over dict - dict.keys() is much better :-)

Languages containing spelling errors can contain a lot of variations of each
word. I'm using spelling misstakes as keys. Spelling misstakes also occur in
programming languages. :-)

Mikkel Rasmussen





More information about the Python-list mailing list