DEV Community

Discussion on: Writing descriptors in Python 3.6+

Collapse
sebastiannielsen profile image
Sebastian-Nielsen

Use WeakKeyDictionary instead of ordinary dictionaries when creating descriptor classes, else you will run into problems (bugs will appear) when you start to delete instances, as those instance won't get garbage deleted:

Watch this:
youtube.com/watch?v=lmcgtUw5djw
time: (15:00)