Skip to content

Commit 28b07ba

Browse files
committed
Merge branch 'main' into update-types-310
2 parents 0317090 + 3328184 commit 28b07ba

37 files changed

+858
-603
lines changed

Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ opt-level = 3
7171

7272
[profile.test]
7373
opt-level = 3
74-
lto = "thin"
74+
# https://github.com/rust-lang/rust/issues/92869
75+
# lto = "thin"
7576

7677
[profile.bench]
7778
lto = true

Lib/inspect.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -302,14 +302,17 @@ def isabstract(object):
302302
"""Return true if the object is an abstract base class (ABC)."""
303303
if not isinstance(object, type):
304304
return False
305-
if object.__flags__ & TPFLAGS_IS_ABSTRACT:
306-
return True
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.
312-
return False
314+
# return False
315+
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.
315318
for name, value in object.__dict__.items():

0 commit comments

Comments
 (0)