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

bpo-26579: Add object.__getstate__(). #2821

Merged
merged 23 commits into from Apr 6, 2022

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Jul 23, 2017

Copying and pickling instances of subclasses of builtin types
bytearray, set, frozenset, collections.OrderedDict, collections.deque,
weakref.WeakSet, and datetime.tzinfo now copies and pickles instance attributes
implemented as slots.

https://bugs.python.org/issue26579

Copying and pickling instances of subclasses of builtin types
bytearray, set, frozenset, collections.OrderedDict, collections.deque,
weakref.WeakSet, and datetime.tzinfo now copies and pickles instance attributes
implemented as slots.
@serhiy-storchaka serhiy-storchaka added the type-feature A feature request or enhancement label Jul 23, 2017
@mention-bot
Copy link

mention-bot commented Jul 23, 2017

@serhiy-storchaka, thanks for your PR! By analyzing the history of the files in this pull request, we identified @pitrou, @rhettinger and @tim-one to be potential reviewers.

Doc/library/pickle.rst Outdated Show resolved Hide resolved
Doc/whatsnew/3.7.rst Outdated Show resolved Hide resolved
Doc/whatsnew/3.7.rst Outdated Show resolved Hide resolved
Added ``object.__getstate__`` which provides the default implementation of
the ``__getstate__()`` method.

Copying and pickling instances of subclasses of builtin types bytearray,
Copy link
Contributor

@ZackerySpytz ZackerySpytz May 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interpreted text roles could be used here.

Copy link
Member Author

@serhiy-storchaka serhiy-storchaka Mar 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but I afraid that it would add too much noise. All links are added in What's New.

@youkaichao
Copy link

youkaichao commented Aug 14, 2020

Any progress? I opened a similar issue about object.__getstate__. Looking forward to this PR being merged!

@github-actions
Copy link

github-actions bot commented Feb 20, 2022

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Feb 20, 2022
Copy link
Contributor

@MaxwellDupre MaxwellDupre left a comment

I'm impressed this is a big change, but unfortunately I couldn't run the full test suite. So starting off with
test_divide_and_round fails with Issue45229 outstanding

Then
test_bad_getattr (Lib.test.pickletester.AbstractPickleTests) ... ERROR

With so many failures:
Test suite interrupted by signal SIGINT.
4 tests omitted:
test_multiprocessing_fork test_multiprocessing_forkserver
test_multiprocessing_spawn test_poplib
378 tests OK.
15 tests failed:
test_asyncio test_dbm test_float test_ftplib test_httplib
test_imaplib test_logging test_nntplib test_ossaudiodev
test_shutil test_ssl test_tk test_ttk_guionly
test_urllib2_localnet test_xmlrpc_net
9 tests skipped:
test_devpoll test_kqueue test_msilib test_nis test_startfile
test_winconsoleio test_winreg test_winsound test_zipfile64
Total duration: 69 min 27 sec
Tests result: FAILURE
cpython on  object-getstate [$?] via 🐍 v3.11.0a3+ took 1h9m27s

Just makes testing a nightmare!

@serhiy-storchaka serhiy-storchaka merged commit 884eba3 into python:main Apr 6, 2022
12 checks passed
@serhiy-storchaka serhiy-storchaka deleted the object-getstate branch Apr 6, 2022
@tacaswell
Copy link
Contributor

tacaswell commented Apr 10, 2022

This has broken cython (see cython/cython#4730).

@da-woods
Copy link
Contributor

da-woods commented Apr 10, 2022

This has broken cython (see cython/cython#4730).

I'm fairly sure the break to Cython is understood and easy to fix in Cython (cython/cython#4730 (comment)) so please don't revert this on Cython's behalf!

@encukou
Copy link
Member

encukou commented Jun 22, 2022

This has also broken jsonpickle: jsonpickle/jsonpickle#395

@AdamWill
Copy link

AdamWill commented Jun 22, 2022

edit: never mind, was looking at the 3.10 docs not the 3.11 docs. 3.11 docs cover what defaultdict does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Stale PR or inactive for long period of time. type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet