frozenlist 1.2.0-1 source package in Ubuntu
Changelog
frozenlist (1.2.0-1) unstable; urgency=low * Initial release -- Piotr Ożarowski <email address hidden> Sun, 28 Nov 2021 15:33:33 +0000
Upload details
- Uploaded by:
- Debian Python Team
- Uploaded to:
- Sid
- Original maintainer:
- Debian Python Team
- Architectures:
- any
- Section:
- misc
- Urgency:
- Low Urgency
See full publishing history Publishing
Series | Published | Component | Section |
---|
Downloads
File | Size | SHA-256 Checksum |
---|---|---|
frozenlist_1.2.0-1.dsc | 2.0 KiB | 705774a200a5ba511b60d4fafd7bb87070e5629e4001a1143b6b6759d75fe747 |
frozenlist_1.2.0.orig.tar.gz | 64.1 KiB | 68201be60ac56aff972dc18085800b6ee07973c49103a8aba669dee3d71079de |
frozenlist_1.2.0-1.debian.tar.xz | 1.9 KiB | 03fcdeaf9fe0c57dee8e1d420574d39ff92ee2a4286c8e02276c7c9bdfe4c247 |
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