[Tutor] Dictionary, integer, compression

Alan Gauld alan.gauld at btinternet.com
Wed Apr 29 18:35:53 CEST 2009

"Dinesh B Vadhia" <dineshbvadhia at hotmail.com> wrote

> Say, you have a dictionary of integers, are the integers stored 
> in a compressed integer format or as integers ie. are integers 
> encoded before being stored in the dictionary and then 
> decoded when read?

I can't think of any reason to compress them, I imagine they 
are stored as integers. But given the way Python handlers 
integers with arbitrarily long numbers etc it may well be more 
complex than a simple integer (ie 4 byte number). But any 
form of compression would be likely to hit performamce 
so I doubt that they would be compressed.

Is there anything that made you think they might be?


Alan Gauld
Author of the Learn to Program web site

More information about the Tutor mailing list