Automatically expiring variable

后端 未结 6 2062
栀梦
栀梦 2021-01-13 08:21

How to implement an automatically expiring variable in python? For example, Let the program running For one hour. I want implement an array of 6 variables, each variable in

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-13 09:07

    It sounds like the items in your array know about each other, because otherwise they'll all expire at the same time.

    I think you want to create a subclass of list which deletes its contents after a certain time.

提交回复
热议问题