Re: validating a class against an ABC at definition time

2011-05-20 Thread Eric Snow
On Thu, May 19, 2011 at 11:33 PM, Eric Snow ericsnowcurren...@gmail.comwrote: Thinking about class APIs and validating a class against an API. The abc module provides the tools to do some of this. One thing I realized, that I hadn't noticed before, is that the abstractness of a class is

Re: validating a class against an ABC at definition time

2011-05-20 Thread Eric Snow
On Fri, May 20, 2011 at 4:55 PM, Eric Snow ericsnowcurren...@gmail.comwrote: I have revised this and made a recipe for it: http://code.activestate.com/recipes/577711-validating-classes-and-objects-against-an-abstract/ I also added this:

validating a class against an ABC at definition time

2011-05-19 Thread Eric Snow
Thinking about class APIs and validating a class against an API. The abc module provides the tools to do some of this. One thing I realized, that I hadn't noticed before, is that the abstractness of a class is measured when instances of the class are created. This happens in object.__new__