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() 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) {