Skip to content

Commit 961e700

Browse files
committed
PR feedback: comment out original inspect.isabstract code
1 parent 5fef026 commit 961e700

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Lib/inspect.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,15 +300,18 @@ def isroutine(object):
300300

301301
def isabstract(object):
302302
"""Return true if the object is an abstract base class (ABC)."""
303-
# TODO: RUSTPYTHON
304-
# TPFLAGS_IS_ABSTRACT is not being set for abstract classes, so this implementation differs from CPython.
305303
if not isinstance(object, type):
306304
return False
305+
# TODO: RUSTPYTHON
306+
# TPFLAGS_IS_ABSTRACT is not being set for abstract classes, so this implementation differs from CPython.
307+
# if object.__flags__ & TPFLAGS_IS_ABSTRACT:
308+
# return True
307309
if not issubclass(type(object), abc.ABCMeta):
308310
return False
309311
if hasattr(object, '__abstractmethods__'):
310312
# It looks like ABCMeta.__new__ has finished running;
311313
# TPFLAGS_IS_ABSTRACT should have been accurate.
314+
# return False
312315
return bool(getattr(object, '__abstractmethods__'))
313316
# It looks like ABCMeta.__new__ has not finished running yet; we're
314317
# probably in __init_subclass__. We'll look for abstractmethods manually.

0 commit comments

Comments
 (0)