Skip to content

Release new version (with fixes for pickling)? #683

@csm10495

Description

@csm10495

Hey folks,

Recent versions of frozenlist seem to not be pickleable. The latest version on pypi is 1.7.0:

In [1]: import frozenlist

In [2]: import pickle

In [3]: f = frozenlist.FrozenList([1,2])

In [4]: pickle.loads(pickle.dumps(f))
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[4], line 1
----> 1 pickle.loads(pickle.dumps(f))

File <stringsource>:2, in frozenlist._frozenlist.FrozenList.__reduce_cython__()

TypeError: self._frozen cannot be converted to a Python object for pickling

In [5]: frozenlist.__version__
Out[5]: '1.7.0'

.. so we fail to pickle on 1.7.0.

However on the latest git hash: d973b7a, it seems to work just fine:

In [1]: import pickle

In [2]: import frozenlist

In [3]: f = frozenlist.FrozenList([1,2])

In [4]: pickle.loads(pickle.dumps(f))
Out[4]: <FrozenList(frozen=False, [1, 2])>

In [5]: f.freeze()

In [6]: pickle.loads(pickle.dumps(f))
Out[6]: <FrozenList(frozen=True, [1, 2])>

In [7]: frozenlist.__version__
Out[7]: '1.7.1.dev0'

Can there be a new release to pypi that has this fixed? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions