Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #5411 > unrolled thread

Re: dict: retrieve the original key by key

Started byChris Rebert <clp2@rebertia.com>
First post2011-05-15 01:44 -0700
Last post2011-05-15 01:44 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: dict: retrieve the original key by key Chris Rebert <clp2@rebertia.com> - 2011-05-15 01:44 -0700

#5411 — Re: dict: retrieve the original key by key

FromChris Rebert <clp2@rebertia.com>
Date2011-05-15 01:44 -0700
SubjectRe: dict: retrieve the original key by key
Message-ID<mailman.1581.1305449069.9059.python-list@python.org>
On Sun, May 15, 2011 at 1:28 AM, Christoph Groth <cwg@falma.de> wrote:
> Dear python experts,
>
> I use a huge python dictionary where the values are lists of that
> dictionary's keys (yes, a graph).  Each key is thus referenced several
> times.
>
> As the keys are rather large objects, I would like to save memory by
> re-using key objects wherever possible, instead of having several equal
> objects in memory.
>
> There does not seem to be a way to retrieve the original key from a
> python dictionary.  Is there a technical reason for this?  (Other than
> that such functionality was not considered to be useful enough.)

Define "original key".

Cheers,
Chris

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web