PEP 246 and a whole lot more
Project description
Do you hate having to write lots of if-then logic to test what type something is? Wouldn’t it be nice if you could just declare “I want this object to have this behavior” and magically convert whatever value you have, to the type you need? PyProtocols lets you do just that, cleanly, quickly, and robustly – even with built-in types or other people’s classes. It’s compatible with (but doesn’t require) Zope and Twisted’s interfaces as well.