aio-libs / aio-libs/frozenlist

Release new version (with fixes for pickling)?

Aperta
#683 10 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
126
Fork
43
Merge medio
1h 52m
PR unite (30g)
13

Descrizione

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 :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: d973b7a74488196b174df4d24ad15424900f8d43, 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]:

In [5]: f.freeze()

In [6]: pickle.loads(pickle.dumps(f))
Out[6]:

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

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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.