Index: Lib/inspect.py =================================================================== --- Lib/inspect.py (revisión: 69009) +++ Lib/inspect.py (copia de trabajo) @@ -246,7 +246,7 @@ def isabstract(object): """Return true if the object is an abstract base class (ABC).""" - return isinstance(object, type) and object.__flags__ & TPFLAGS_IS_ABSTRACT + return bool(isinstance(object, type) and object.__flags__ & TPFLAGS_IS_ABSTRACT) def getmembers(object, predicate=None): """Return all members of an object as (name, value) pairs sorted by name. Index: Lib/test/test_inspect.py =================================================================== --- Lib/test/test_inspect.py (revisión: 69009) +++ Lib/test/test_inspect.py (copia de trabajo) @@ -3,6 +3,7 @@ import unittest import inspect import datetime +import numbers from test.test_support import TESTFN, run_unittest @@ -112,7 +113,12 @@ self.assert_('a' in members) self.assert_('b' not in members) + def test_isabstract(self): + self.assertTrue(inspect.isabstract(numbers.Integral)) + self.assertFalse(inspect.isabstract(int)) + self.assertFalse(inspect.isabstract(5)) + class TestInterpreterStack(IsTestBase): def __init__(self, *args, **kwargs): unittest.TestCase.__init__(self, *args, **kwargs)