Method restrictions (abstract, final, @override etc.) and implementing them for Python
[EuroPython 2012] P Szabo - 3 JULY 2012 in "Track Tagliatelle"
The earlier a bug is discovered, the cheaper it is to fix it. Method restrictions (such as abstract, final and @Override) help the programmer in discovering incompatibilities between a class and its subclass early (i.e. at startup time for Python and at compile time for compiled languages). Python doesn’t provide method restrictions out of the box. To implement them, we take a deep dive to the realms of Python metaprogramming (decorators, metaclasses, method wrappers, traceback inspection and builtins). Lots of short and code examples will be provided to show the building blocks and how we combine them. Slides: http://pts-mini-gpl.googlecode.com/svn/trunk/pobjects/ptsmethodrestri ctions_2012-07-03.html Source code download: http://code.google.com/p/pts-mini- gpl/source/browse/#svn/trunk/pobjects