More from this series

Squinting at Python Objects

Brandon Craig RhodesPython 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.