En Fri, 13 Mar 2009 14:49:51 -0200, Tim Wintle <tim.win...@teamrubber.com>
escribió:
If the same chromosome string is being used multiple times then you may
find it more efficient to reference the same string, so you don't need
to have multiple copies of the same string in memory. That may be what
is taking up the space.
i.e. something like (written verbosely)
reference_dict = {}
for (chromosome,posn) in my_file:
chromosome = reference_dict.setdefault(chromosome,chromosome)
Note that the intern() builtin does exactly that: chromosome =
intern(chromosome)
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list