PyOhio 2011: Squinting at Python Objects
Squinting at Python Objects
Presented by Brandon Craig Rhodes
Python classes can gain attributes as if by magic. Thanks to properties, descriptors, and (if all else fails) getattr() and getattribute(), the attempt to access obj.something can result in arbitrary code execution. If you are wondering how your Python program is using memory, this can result in a problem: each time you look to see if something is there, it is, because it is pulled in dynamically the moment you look for it. In this talk, you will learn how to prod Python objects gently, and hopefully learn their secrets - and their memory usage - without actually invoking code.