File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 111.5.1 (in development)
22======================
33
4+ - ` cloudpickle ` 's pickle.Pickler subclass (currently defined as
5+ ` cloudpickle.cloudpickle_fast.CloudPickler ` ) can and should now be accessed
6+ as ` cloudpickle.Pickler ` . This is the only officially supported way of
7+ accessing it.
8+ ([ issue #366 ] ( https://github.com/cloudpipe/cloudpickle/issues/366 ) )
9+
410
5111.5.0
612=====
Original file line number Diff line number Diff line change 44from cloudpickle .cloudpickle import * # noqa
55from cloudpickle .cloudpickle_fast import CloudPickler , dumps , dump # noqa
66
7+ # Conform to the convention used by python serialization libraries, which
8+ # expose their Pickler subclass at top-level under the "Pickler" name.
9+ Pickler = CloudPickler
10+
711__version__ = '1.5.1dev0'
Original file line number Diff line number Diff line change @@ -2342,5 +2342,12 @@ class C(typing.Generic[T]):
23422342 return types_to_test
23432343
23442344
2345+ def test_module_level_pickler ():
2346+ # #366: cloudpickle should expose its pickle.Pickler subclass as
2347+ # cloudpickle.Pickler
2348+ assert hasattr (cloudpickle , "Pickler" )
2349+ assert cloudpickle .Pickler is cloudpickle .CloudPickler
2350+
2351+
23452352if __name__ == '__main__' :
23462353 unittest .main ()
You can’t perform that action at this time.
0 commit comments