[Python-3000] Should ABCMeta.register() do validation and emit warnings

Fred Drake fdrake at acm.org
Thu Feb 7 17:36:51 CET 2008


On Feb 7, 2008, at 11:27 AM, Christian Heimes wrote:
> You are correct. Normally interfaces are only validated in unit tests.
> The validation function of zope.interface checks if a class implements
> or object provides the promised methods and attributes. It also  
> compares
> the method signatures.


Note also that checking the "class implements" is frequently  
problematic since the verification doesn't know what the factory does  
to the object (where the factory is the constructor provided by the  
class in most cases).  We frequently test instances this way in unit  
tests.


   -Fred

-- 
Fred Drake   <fdrake at acm.org>






More information about the Python-3000 mailing list