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 eric.araujo, rhettinger, stutzbach
Date 2010-07-10.23:42:23
SpamBayes Score 0.000366428
Marked as misclassified No
Message-id <1278805345.36.0.729772848157.issue9212@psf.upfronthosting.co.za>
In-reply-to
Content
In this case, the concrete class is the one missing a method.  

Concrete classes are allowed to provide more features than the corresponding ABC, but the converse is not true to the best of my knowledge.

dict_keys .register()s as supporting the Set ABC, so it does not automatically pick up the method through inheritance.  Put another way:

>>> # dict_keys provides the Set ABC API
>>> isinstance({}.keys(), collections.Set)
True

>>> # The Set ABC provides isdisjoint
>>> hasattr(collections.Set, 'isdisjoint') 
True

>>> # Ergo, dict_keys should provide isdisjoint ... but it doesn't
>>> hasattr({}.keys(), 'isdisjoint')       
False

See also Issue9213 for another case where a concrete class is missing a method provided by an ABC it claims to support.

I sort of wonder if .register() should verify that the concrete class provides all of the methods of the ABC.
History
Date User Action Args
2010-07-10 23:42:25stutzbachsetrecipients: + stutzbach, rhettinger, eric.araujo
2010-07-10 23:42:25stutzbachsetmessageid: <1278805345.36.0.729772848157.issue9212@psf.upfronthosting.co.za>
2010-07-10 23:42:24stutzbachlinkissue9212 messages
2010-07-10 23:42:23stutzbachcreate