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 So8res
Recipients So8res
Date 2017-03-15.17:06:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1489597569.75.0.0334116955024.issue29822@psf.upfronthosting.co.za>
In-reply-to
Content
Here's an example test that fails:

def test_isabstract_during_init_subclass(self):
    from abc import ABCMeta, abstractmethod

    isabstract_checks = []

    class AbstractChecker(metaclass=ABCMeta):
        def __init_subclass__(cls):
            abstract_checks.append(inspect.isabstract(cls))

    class AbstractClassExample(AbstractChecker):

        @abstractmethod
        def foo(self):
            pass

    class ClassExample(AbstractClassExample):
        def foo(self):
            pass

    self.assertEqual(isabstract_checks, [True, False])

To run the test, you'll need to be on a version of python where bpo-29581 is fixed (e.g., a cpython branch with https://github.com/python/cpython/pull/527 merged) in order for __init_subclass__ to work with ABCMeta at all in the first place. I have a simple patch to inspect.isabstract that fixes this, and will make a PR shortly.
History
Date User Action Args
2017-03-15 17:06:09So8ressetrecipients: + So8res
2017-03-15 17:06:09So8ressetmessageid: <1489597569.75.0.0334116955024.issue29822@psf.upfronthosting.co.za>
2017-03-15 17:06:09So8reslinkissue29822 messages
2017-03-15 17:06:09So8rescreate