mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Store ContextVar.name as the original str object (#8682)
* Store ContextVar.name as the original str object Keep the constructor argument instead of converting it to a Rust String so lone surrogates and str subclasses are preserved. Build __repr__ from the name and default reprs. Assisted-by: Grok:4.6 * Compare Context objects by their variable maps Implement Context ==/!= from the mapping contents and mark Context unhashable. Snapshot the map before value equality so re-entrant ContextVar.set during __eq__ cannot deadlock. Enable test_context.ContextTest.test_context_run_4. Assisted-by: Grok:4.6
This commit is contained in:
1 parent
2fc2479f72
commit
5afe140abd
3 files changed
+120
-21
No files matched your search
Vendored
-1
@@ -163,7 +163,6 @@ class ContextTest(unittest.TestCase):
|
||||
with self.assertRaises(ZeroDivisionError):
|
||||
ctx.run(func, 1, 2, a=123)
|
||||
|
||||
@unittest.expectedFailure # TODO: RUSTPYTHON
|
||||
@isolated_context
|
||||
def test_context_run_4(self):
|
||||
ctx1 = contextvars.Context()
|
||||
|
||||
Reference in new issue
Block a user