[Python-3000] An introduction to ABC's (original) (raw)

Emin.shopper Martinian.shopper emin.shopper at gmail.com
Tue Apr 24 16:39:45 CEST 2007


Dear Guido, Talin, and other Python Experts,

I would like to register my strong support/encouragement for some type of abstract base class (ABC) mechanism in python. While I think dynamism, reflection, duck-typing, unit tests, etc. are wonderful, I often come across situations where ABCs are very useful.

For example, when writing programs which take a long time to run (e.g., numerical work or large simulations), it is very painful to run a unit test that takes many minutes or even hours to run only to discover that a newly defined class is missing a crucial method. By using ABCs appropriately, I can make sure that all classes have the required methods as soon as a class is imported instead of part-way through the simulation.

Below are links to the ABC implementation based on meta-classes and decorators which I have been using for quite a while.

http://mail.python.org/pipermail/python-list/2006-December/419941.html http://alum.mit.edu/www/emin/source_code/py_abc/abc.py

Some features of this module include:

Sincerely, -Emin Martinian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-3000/attachments/20070424/d538d5be/attachment.html



More information about the Python-3000 mailing list