[Tutor] managing memory large dictionaries in python

Steven D'Aprano steve at pearwood.info
Wed Oct 17 13:42:30 CEST 2012


On 17/10/12 12:30, Dwight Hutto wrote:

> My inexperienced advice would be to begin with the storage areas
> available. I would begin by eliminating certain things such as:
>
> x = {'one_entry' : 1}
>
> into
>
> x = {'one_entry':1}


Those two entries are exactly the same. The presence of absence of
spaces, or newlines, in the dict literal makes no difference to the
amount of memory that the dict will use.



-- 
Steven


More information about the Tutor mailing list