You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix annotation scope, deadlock, MRO, and HEAPTYPE issues (RustPython#7087)
* Fix annotation scope, deadlock, MRO, and HEAPTYPE issues
Annotation scope:
- Remove module-level annotation re-scan that created phantom
sub_tables, breaking annotation closure for comprehensions
- Add async comprehension check in symbol table with
is_in_async_context(); annotation/type-params scopes are
always non-async
- Save/restore CompileContext in enter/exit_annotation_scope
to reset in_async_scope
Deadlock prevention:
- Fix TypeVar/ParamSpec/TypeVarTuple __default__ and
evaluate_default by cloning lock contents before acquiring
a second lock or calling Python
Other fixes:
- Add HEAPTYPE flag to Generic for correct pickle behavior
- Guard heaptype_ext access in name_inner/set___name__/
set___qualname__ with safe checks instead of unwrap
- Fix MRO error message to include base class names
- Add "format" to varnames in TypeAlias annotation scopes
- Fix single-element tuple repr to include trailing comma
* Unmark failing markers
check_syntax_error(self, "def f[T: [(x := 3) for _ in range(2)]](): pass")
149
149
check_syntax_error(self, "type T = [(x := 3) for _ in range(2)]")
150
150
151
-
@unittest.expectedFailure# TODO: RUSTPYTHON; AssertionError: "\(MRO\) for bases object, Generic" does not match "Unable to find mro order which keeps local precedence ordering"
152
151
deftest_incorrect_mro_explicit_object(self):
153
152
withself.assertRaisesRegex(TypeError, r"\(MRO\) for bases object, Generic"):
0 commit comments