This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author stutzbach
Recipients benjamin.peterson, eric.araujo, gvanrossum, stutzbach
Date 2010-09-01.13:02:30
SpamBayes Score 3.5694907e-09
Marked as misclassified No
Message-id <1283346153.7.0.611629242062.issue9731@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2010-09-01 13:02:33stutzbachsetrecipients: + stutzbach, gvanrossum, benjamin.peterson, eric.araujo
2010-09-01 13:02:33stutzbachsetmessageid: <1283346153.7.0.611629242062.issue9731@psf.upfronthosting.co.za>
2010-09-01 13:02:31stutzbachlinkissue9731 messages
2010-09-01 13:02:30stutzbachcreate