Python references and solutions to reference problems

Published: 25 October 2008
on channel: pycon08
1,003
4

Dr. Tim Couper

The talk gives a clear presentation of:

Reference counting (sys.getrefcount and how it works)
Circular references (gc.collect as a means of finding them)
Weak references (weakref.ref as a means of resolution)
Pickling classes with weak references (cPickle/pickle module, __getstate__, __setstate__)

Along the way, we'll introduce a couple of interesting patterns which can be used to solve common classes of circular reference problems. As a side-benefit, the patterns demonstrate the clean and practical uses of properties and mixin classes (how to make a pickleable, circular-reference-free subclass of a pickleable, circular-reference-strapped class), and, of course, use the unittest framework to check that our classes always stays circular-reference-free.


On this page of the site you can watch the video online Python references and solutions to reference problems with a duration of hours minute second in good quality, which was uploaded by the user pycon08 25 October 2008, share the link with friends and acquaintances, this video has already been watched 1,003 times on youtube and it was liked by 4 viewers. Enjoy your viewing!