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

Guido van Rossum guido at python.org
Thu Feb 7 03:29:59 CET 2008


On Feb 6, 2008 5:17 PM, Raymond Hettinger <python at rcn.com> wrote:
> It's interesting that tuples could be registered as Sequences without having all the requisite methods.  Should the register() method to some sort of validation that all public methods in the ABC are in the class/type being registered?

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. :-)

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list