Python: How to create a common element between a list and a dict

前端 未结 4 2122
旧时难觅i
旧时难觅i 2021-01-22 14:57

I am new to data structures in python and was wondering how do you simulate a thing like pointers in python so that multiple structures can refer and manage the same piece of da

4条回答
  •  不知归路
    2021-01-22 15:32

    You can always do things like this:

    Pointers in Python?

    (a quick stackoverflow search shows some results)

    But that is messing with more than just data structures. Remember that Python manages memory for you (in most of the cases, pretty well), so you don't have to worry of cleaning after yourself.

提交回复
热议问题