File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -300,15 +300,18 @@ def isroutine(object):
300300
301301def 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.
You can’t perform that action at this time.
0 commit comments