[issue9731] Add ABCMeta.has_methods and tests that use it

Daniel Stutzbach report at bugs.python.org
Wed Sep 1 17:31:17 CEST 2010


Daniel Stutzbach <daniel at 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 <report at bugs.python.org>
<http://bugs.python.org/issue9731>
_______________________________________


More information about the Python-bugs-list mailing list