weakref list in python

后端 未结 6 1392
感情败类
感情败类 2021-02-04 05:08

I\'m in need of a list of weak references that deletes items when they die. Currently the only way I have of doing this is to keep flushing the list (removing dead references ma

6条回答
  •  轮回少年
    2021-02-04 05:23

    As I needed a weakref list like you, I've made one and publish it on pypi.

    now you can do:

    pip install weakreflist
    

    then:

    from weakreflist import WeakList
    

提交回复
热议问题