Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
1.5.1 (in development)
======================

- `cloudpickle`'s pickle.Pickler subclass (currently defined as
`cloudpickle.cloudpickle_fast.CloudPickler`) can and should now be accessed
as `cloudpickle.Pickler`. This is the only officially supported way of
accessing it.
([issue #366](https://github.com/cloudpipe/cloudpickle/issues/366))


1.5.0
=====
Expand Down
4 changes: 4 additions & 0 deletions cloudpickle/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@
from cloudpickle.cloudpickle import * # noqa
from cloudpickle.cloudpickle_fast import CloudPickler, dumps, dump # noqa

# Conform to the convention used by python serialization libraries, which
# expose their Pickler subclass at top-level under the "Pickler" name.
Pickler = CloudPickler

__version__ = '1.5.1dev0'
7 changes: 7 additions & 0 deletions tests/cloudpickle_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2342,5 +2342,12 @@ class C(typing.Generic[T]):
return types_to_test


def test_module_level_pickler():
# #366: cloudpickle should expose its pickle.Pickler subclass as
# cloudpickle.Pickler
assert hasattr(cloudpickle, "Pickler")
assert cloudpickle.Pickler is cloudpickle.CloudPickler


if __name__ == '__main__':
unittest.main()