1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
3 NAMEBASE= python-ordered-set
7 SDESC[py310]= Custom MutableSet that stays in order (3.10)
8 SDESC[py311]= Custom MutableSet that stays in order (3.11)
10 CONTACT= Python_Automaton[python@ironwolf.systems]
13 SITES[main]= PYPIWHL/33/55/af02708f230eb77084a299d7b08175cff006dea4f2721074b92cdb0296c0
14 DISTFILE[1]= ordered_set-4.1.0-py3-none-any.whl:main
19 OPTIONS_AVAILABLE= PY310 PY311
20 OPTIONS_STANDARD= none
21 VOPTS[py310]= PY310=ON PY311=OFF
22 VOPTS[py311]= PY310=OFF PY311=ON
24 DISTNAME= ordered_set-4.1.0.dist-info
28 [PY310].USES_ON= python:py310,wheel
30 [PY311].USES_ON= python:py311,wheel
32 [FILE:2460:descriptions/desc.single]
35 An OrderedSet is a mutable data structure that is a hybrid of a list and a
37 It remembers the order of its entries, and every entry has an index number
43 `ordered_set` is available on PyPI and packaged as a wheel. You can list it
44 as a dependency of your project, in whatever form that takes.
46 To install it into your current Python environment:
48 pip install ordered-set
50 To install the code for development, after checking out the repository:
57 An OrderedSet is created and used like a set:
59 >>> from ordered_set import OrderedSet
61 >>> letters = OrderedSet('abracadabra')
64 OrderedSet(['a', 'b', 'r', 'c', 'd'])
69 It is efficient to find the index of an entry in an OrderedSet, or find an
70 entry by its index. To help with this use case, the `.add()` method returns
71 the index of the added item, whether it was already in the set or not.
73 >>> letters.index('r')
85 OrderedSets implement the union (`|`), intersection (`&`), and difference
87 operators like sets do.
89 >>> letters |= OrderedSet('shazam')
92 OrderedSet(['a', 'b', 'r', 'c', 'd', 'x', 's', 'h', 'z', 'm'])
94 >>> letters & set('aeiou')
100 OrderedSet(['r', 'x', 's', 'h', 'z', 'm'])
102 The `__getitem__()` and `index()` methods have been extended to accept any
103 iterable except a string, returning a list, to perform NumPy-like "fancy
106 >>> letters = OrderedSet('abracadabra')
108 >>> letters[[0, 2, 3]]
111 >>> letters.index(['a', 'r', 'c'])
114 OrderedSet implements `__getstate__` and `__setstate__` so it can be
116 and implements the abstract base classes `collections.MutableSet` and
117 `collections.Sequence`.
119 OrderedSet can be used as a generic collection type, similar to the
121 in the `typing` module like List, Dict, and Set. For example, you can
123 a variable as having the type `OrderedSet[str]` or `OrderedSet[Tuple[int,
126 ## OrderedSet in data science applications
128 An OrderedSet can be used as a bi-directional mapping between a sparse
129 vocabulary and dense index numbers. As of version 3.1, it accepts NumPy
131 of index numbers as well as lists.
136 046e1132c71fcf3330438a539928932caf51ddbc582496833e23de611de14562 7634 ordered_set-4.1.0-py3-none-any.whl