New submission from Daniel Stutzbach <dan...@stutzbachenterprises.com>:

In Issue 9212, I mused:

> I sort of wonder if .register() should verify that the concrete class
> provides all of the methods of the ABC.

Éric Araujo suggested I open that as an issue for consideration.  

I have found a few bugs in the standard library where a concrete class did not 
actually implement all of the methods of the ABC that it purported to 
implement.  Specifically:

dict's keys view claims to implement the Set ABC but doesn't provide the 
is_disjoint method (Issue 9212)

range objects claims to support the Sequence ABC but don't provide the count 
and index methods (Issue 9213)

Should ABCMeta.register verify that the type implements all of the appropriate 
methods?

On the one hand, that would prevent similar bugs from sneaking by.  On the 
other hand, it's extra code that would get executed every time Python started 
(site.py imports os.py which imports _abcoll.py).

Thoughts?

----------
components: Library (Lib)
messages: 115293
nosy: benjamin.peterson, eric.araujo, gvanrossum, stutzbach
priority: normal
severity: normal
status: open
title: ABCMeta.register should verify that methods are present
type: feature request
versions: Python 3.2

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9731>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to