Daniel Stutzbach <dan...@stutzbachenterprises.com> added the comment:

Re-opening and re-titling the issue to that effect.

Proposed syntax and usage:

# in Lib/abc.py
class ABCMeta(type):
    # ...

    def has_methods(cls, subclass):
        "Returns True iff subclass implements the appropriate methods"
        # ...

Usage within the unit tests:

# In Lib/test/test_collections.py
    def test_methods(self):
        self.assertTrue(Sequence.has_methods(range))
        self.assertTrue(MutableSet.has_methods(set))
        # ... and many more

----------
assignee:  -> stutzbach
components: +Tests
resolution: rejected -> accepted
stage:  -> needs patch
status: closed -> open
title: ABCMeta.register should verify that methods are present -> Add 
ABCMeta.has_methods and tests that use it

_______________________________________
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