Re: nested structure with "internal references"



On Sep 25, 1:11 pm, Torsten Mohr <tm...@xxxxxxxxxx> wrote:
Hi,

sorry for posting in german before, that was a mistake.

I'd like to use a nested structure in memory that consists
of dict()s and list()s, list entries can be dict()s, other list()s,
dict entries can be list()s or other dict()s.

The lists and dicts can also contain int, float, string, ...

But i'd also like to have something like a "reference" to another
entry.
I'd like to refer to another entry and not copy that entry, i need to
know later that this is a reference to another entry, i need to find
also access that entry then.

Is something like this possible in Python?

The references only need to refer to entries in this structure.
The lists may change at runtime (entries removed / added), so
storing the index may not help.

Thanks for any hints,
Torsten.

hello,

maybe i know less python than you do, but i am talking from the point
of view of my common sense and experience. if you store an object in a
list more than once, i doubt that python creates a duplicate. unless
the object is a value type. thus you have a reference to this object
in both elements. and then if you are asking this question, maybe your
design is not good enough? would you explain the problem?
konstantin
.



Relevant Pages

  • Re: Solving the lib mismatch problem
    ... This section is pointed to by an entry in the section table with the ... The number of entries in the table is determined by DT_VERDEFNUM. ... This is an index into the string section referenced in the section ... Offset in the string section reference by the link in the section ...
    (comp.unix.programmer)
  • Re: Autoruns
    ... It's impossible for AutoRuns to keep a database of all software available and what you may have installed on your system and then uninstalled (with the uninstalled software not deleting it's own entries from the registry properly or completely), or indeed what 3rd party software is essential at boot-up and what isn't. ... It's just a matter of going through the categories in AutoRuns and also looking in Task Manager's Processes list and/or using the similar lists, but with full path info., from the system info. freeware program 'Everest' which you can find and download with a google search and will help you identify which entries belong to which software packages by virtue of the full path. ... Finally don't delete an entry from AutoRuns, just uncheck it so that it is restorable later. ...
    (microsoft.public.windowsxp.general)
  • Re: a benefit to using a linked list in insertion sort?
    ... >> Use linked lists to make insertions easy, ... >> isn't a binary search at all but a hash table. ... You "probe" the entry at this index. ... rather than having to insert and move subsequent entries as ...
    (comp.programming)
  • Re: Cross Referencing Lists (REVISED)
    ... of entries in column A to be reduced as follows. ... there is an entry in column A that has an entry in column B ... >>Frank Kabel ... >>>>> confusing perhaps I can email the 2 lists to someone ...
    (microsoft.public.excel.worksheet.functions)
  • Re: World book software?
    ... want it to automatically recognize terms that have entries and hot ... For bonus points the main entry should ... have a list of links that go to other entries that reference the ...
    (rec.games.frp.misc)

Loading