Thursday, January 15, 2009

OOP in an Hour

Learn OOP the Python way, from a master. Sure, it's a home movie in some ways, but that's part of its charm.

This takes us back a ways, to the dawn of Python 2.3 when the property descriptor was introduced. What's a descriptor again? If you've heisted the __set__, __get__ and __delete__ rib cage, that makes you one.

Note: every Python class comes with a "rib cage" of special names or __ribs__, for which you're free to define special behaviors. Snakes have lots of ribs so this all makes some sense, no?