From 1433d87ad4ff2d06604f0cc9f025a82f236311cc Mon Sep 17 00:00:00 2001 From: gnsxun Date: Sun, 22 May 2022 11:07:41 +0900 Subject: [PATCH 1/2] Add NotImplemted.reduce() --- vm/src/builtins/singletons.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vm/src/builtins/singletons.rs b/vm/src/builtins/singletons.rs index bc5718fbc08..0f3b9870595 100644 --- a/vm/src/builtins/singletons.rs +++ b/vm/src/builtins/singletons.rs @@ -84,6 +84,11 @@ impl PyNotImplemented { fn repr(&self) -> String { "NotImplemented".to_owned() } + + #[pymethod(magic)] + fn reduce(&self) -> String { + "NotImplemented".to_owned() + } } pub fn init(context: &Context) { From e5816a40ad18d85527e8ba785f16af7dffd1cd4d Mon Sep 17 00:00:00 2001 From: gnsxun Date: Sun, 22 May 2022 13:07:02 +0900 Subject: [PATCH 2/2] delete expectedFailture --- Lib/test/test_pickle.py | 8 -------- Lib/test/test_pickletools.py | 4 ---- 2 files changed, 12 deletions(-) diff --git a/Lib/test/test_pickle.py b/Lib/test/test_pickle.py index 39f0dd63686..bd3dfcb3d18 100644 --- a/Lib/test/test_pickle.py +++ b/Lib/test/test_pickle.py @@ -130,8 +130,6 @@ def test_newobj_generic(self): # TODO: RUSTPYTHON, remove when this passes def test_newobj_proxies(self): # TODO: RUSTPYTHON, remove when this passes super().test_newobj_proxies() # TODO: RUSTPYTHON, remove when this passes - # TODO: RUSTPYTHON, TypeError: cannot pickle 'NotImplementedType' object - @unittest.expectedFailure def test_notimplemented(self): # TODO: RUSTPYTHON, remove when this passes super().test_notimplemented() # TODO: RUSTPYTHON, remove when this passes @@ -165,8 +163,6 @@ def test_py_methods(self): # TODO: RUSTPYTHON, remove when this passes def test_recursive_nested_names(self): # TODO: RUSTPYTHON, remove when this passes super().test_recursive_nested_names() # TODO: RUSTPYTHON, remove when this passes - # TODO: RUSTPYTHON, TypeError: cannot pickle 'NotImplementedType' object - @unittest.expectedFailure def test_singleton_types(self): # TODO: RUSTPYTHON, remove when this passes super().test_singleton_types() # TODO: RUSTPYTHON, remove when this passes @@ -251,8 +247,6 @@ def test_newobj_generic(self): # TODO: RUSTPYTHON, remove when this passes def test_newobj_proxies(self): # TODO: RUSTPYTHON, remove when this passes super().test_newobj_proxies() # TODO: RUSTPYTHON, remove when this passes - # TODO: RUSTPYTHON, TypeError: cannot pickle 'NotImplementedType' object - @unittest.expectedFailure def test_notimplemented(self): # TODO: RUSTPYTHON, remove when this passes super().test_notimplemented() # TODO: RUSTPYTHON, remove when this passes @@ -286,8 +280,6 @@ def test_py_methods(self): # TODO: RUSTPYTHON, remove when this passes def test_recursive_nested_names(self): # TODO: RUSTPYTHON, remove when this passes super().test_recursive_nested_names() # TODO: RUSTPYTHON, remove when this passes - # TODO: RUSTPYTHON, TypeError: cannot pickle 'NotImplementedType' object - @unittest.expectedFailure def test_singleton_types(self): # TODO: RUSTPYTHON, remove when this passes super().test_singleton_types() # TODO: RUSTPYTHON, remove when this passes diff --git a/Lib/test/test_pickletools.py b/Lib/test/test_pickletools.py index ae4b7eb1785..fad54880ff6 100644 --- a/Lib/test/test_pickletools.py +++ b/Lib/test/test_pickletools.py @@ -52,8 +52,6 @@ def test_newobj_generic(self): # TODO: RUSTPYTHON, remove when this passes def test_newobj_proxies(self): # TODO: RUSTPYTHON, remove when this passes super().test_newobj_proxies() - # TODO: RUSTPYTHON, TypeError: cannot pickle 'NotImplementedType' object - @unittest.expectedFailure def test_notimplemented(self): # TODO: RUSTPYTHON, remove when this passes super().test_notimplemented() @@ -87,8 +85,6 @@ def test_py_methods(self): # TODO: RUSTPYTHON, remove when this passes def test_recursive_nested_names(self): # TODO: RUSTPYTHON, remove when this passes super().test_recursive_nested_names() - # TODO: RUSTPYTHON, TypeError: cannot pickle 'NotImplementedType' object - @unittest.expectedFailure def test_singleton_types(self): # TODO: RUSTPYTHON, remove when this passes super().test_singleton_types()