Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement missing __reduce__ and __reduce_ex__ for several types #3611

Open
1 of 27 tasks
Snowapril opened this issue Apr 14, 2022 · 0 comments
Open
1 of 27 tasks

Implement missing __reduce__ and __reduce_ex__ for several types #3611

Snowapril opened this issue Apr 14, 2022 · 0 comments
Labels

Comments

@Snowapril
Copy link
Contributor

@Snowapril Snowapril commented Apr 14, 2022

Feature

Many existing test cases check that pickle.dumps and pickle.loads of a given type return the exact same value. Almost failed pickle test in RustPython, lack __reduce__ method.

  • arrayiterator.__reduce__ (test_array::test_iterator_pickle)
  • filter.__reduce__ (test_builtin::test_filter_pickle)
  • map.__reduce__ (test_builtin::test_map_pickle)
  • ImportError.__reduce__ (test_exceptions::test_copy_pickle)
  • OSError.__reduce__
  • BaseException.__reduce__#3665
  • method.__reduce__
  • groupby.__reduce__
  • _grouper.__reduce__
  • tee.__reduce__
  • cycle.__reduce__
  • dropwhile.__reduce__
  • takewhile.__reduce__
  • islice.__reduce__
  • starmap.__reduce__
  • chain.__reduce__
  • product.__reduce__
  • combinations.__reduce__
  • combinations_with_replacement.__reduce__
  • permutations.__reduce__
  • accumulate.__reduce__
  • compress.__reduce__
  • filterfalse.__reduce__
  • count.__reduce__
  • zip_longest.__reduce__
  • NotImplemented.__reduce__
  • types.SimpleNamespace.__reduce__

These listed elements are almost similar and quite simple to implement.
Please take a look at many PR and existing codes for __reduce__

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants