richset interpolate between list, dict, set and iterables.
Project description
richset
from dataclasses import dataclass
from richset import RichSet
@dataclass(frozen=True)
class Something:
id: int
name: str
richset = RichSet.from_list([
Something(1, 'one'),
Something(2, 'two'),
])
richset.to_list() # => [Something(1, 'one'), Something(2, 'one')]
richset.to_dict(lambda s: s.id) # => {1: Something(1, 'one'), 2: Something(2, 'one')}
LICENSE
The 3-Clause BSD License. See also LICENSE file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
richset-0.0.1.tar.gz
(14.2 kB
view hashes)