Skip to content
Advertisement

Tag: mutable

Alias for long list name and modification

I have a nested data structure (e.g. mydict[names[num]]) which is difficult to read in code. Hence I would like to create a proxy (alias) and use it to modify this structure. Given the AssertionError on id(a) = id(b), do I understand correctly python separates short and long_name during comprehension and allocates separate memory? In practice, my structure contains millions of

Advertisement