Re: optimizing large dictionaries

2009-01-16 Thread Matthias Julius
Per Freem perfr...@yahoo.com writes: the only 'twist' is that my elt is an instance of a class (MyClass) with 3 fields, all numeric. the class is hashable, and so my_dict[elt] works well. the __repr__ and __hash__ methods of my class simply return str() representation of self, which just

Re: Is numeric keys of Python's dictionary automatically sorted?

2007-03-08 Thread Matthias Julius
John [EMAIL PROTECTED] writes: I am coding a radix sort in python and I think that Python's dictionary may be a choice for bucket. The only problem is that dictionary is a mapping without order. But I just found that if the keys are numeric, the keys themselves are ordered in the

Re: How to Read Bytes from a file

2007-03-06 Thread Matthias Julius
Gabriel Genellina [EMAIL PROTECTED] writes: En Fri, 02 Mar 2007 08:22:36 -0300, Bart Ogryczak [EMAIL PROTECTED] escribió: On Mar 1, 7:36 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Thanks Bart. That's perfect. The other suggestion was to precompute count1 for all possible bytes, I