frozenlist 1.4.0-1 source package in Ubuntu
Changelog
frozenlist (1.4.0-1) unstable; urgency=medium * New upstream release -- Piotr Ożarowski <email address hidden> Fri, 21 Jul 2023 14:07:00 +0200
Upload details
- Uploaded by:
- Debian Python Team
- Uploaded to:
- Sid
- Original maintainer:
- Debian Python Team
- Architectures:
- any
- Section:
- misc
- Urgency:
- Medium Urgency
See full publishing history Publishing
Series | Published | Component | Section | |
---|---|---|---|---|
Mantic | release | universe | misc |
Downloads
File | Size | SHA-256 Checksum |
---|---|---|
frozenlist_1.4.0-1.dsc | 2.0 KiB | 688c6700c70440f3444d71e2cb695b96d64fe6fdfd9b48ddff12b2e8edbc08c7 |
frozenlist_1.4.0.orig.tar.gz | 88.6 KiB | 09163bdf0b2907454042edb19f887c6d33806adc71fbd54afc14908bfdc22251 |
frozenlist_1.4.0-1.debian.tar.xz | 2.2 KiB | d400a6eb527ba04797b95020908a41f70eb9412efd14c26ec1fd31ee82dca8da |
Available diffs
No changes file available.
Binary packages built by this source
- python3-frozenlist: list-like structure which implements collections.abc.MutableSequence
`frozenlist.
FrozenList` is a list-like structure which implements
`collections.abc.MutableSequ ence`. The list is mutable until `FrozenList.freeze`
is called, after which list modifications raise `RuntimeError`:
.
>>> from frozenlist import FrozenList
>>> fl = FrozenList([17, 42])
>>> fl.append('spam')
>>> fl.append('Vikings' )
>>> fl
<FrozenList(frozen= False, [17, 42, 'spam', 'Vikings'])>
>>> fl.freeze()
>>> fl
<FrozenList(frozen= True, [17, 42, 'spam', 'Vikings'])>
>>> fl.frozen
True
>>> fl.append("Monty")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "frozenlist/_frozenlist. pyx", line 97, in frozenlist. _frozenlist. FrozenList. append
self._check_ frozen( )
File "frozenlist/_frozenlist. pyx", line 19, in frozenlist. _frozenlist. FrozenList. _check_ frozen
raise RuntimeError("Cannot modify frozen list.")
RuntimeError: Cannot modify frozen list.
.
FrozenList is also hashable, but only when frozen. Otherwise it also throws a RuntimeError:
.
>>> fl = FrozenList([17, 42, 'spam'])
>>> hash(fl)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "frozenlist/_frozenlist. pyx", line 111, in frozenlist. _frozenlist. FrozenList. __hash_ _
raise RuntimeError("Cannot hash unfrozen list.")
RuntimeError: Cannot hash unfrozen list.
>>> fl.freeze()
>>> hash(fl)
3713081631934410656
>>> dictionary = {fl: 'Vikings'} # frozen fl can be a dict key
>>> dictionary
{<FrozenList(frozen= True, [1, 2])>: 'Vikings'}
- python3-frozenlist-dbgsym: debug symbols for python3-frozenlist