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

Christian Heimes lists at cheimes.de
Thu Feb 7 17:27:42 CET 2008


Guido van Rossum wrote:
> I think the Zope/Twisted interfaces have gone here before. I believe
> they have a separate validation call which is typically only invoked
> in unittests. The validation can be pretty expensive, so running the
> validation each time the interpreter is started would just slow things
> down. I've just not yet written the validation code. :-)

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.

Christian



More information about the Python-3000 mailing list