Metadata-Version: 2.1
Name: Ordered-set-37
Version: 2.0
Summary: Dead simple & fast ordered set using python's 3.7+ dict.
Home-page: https://github.com/bustawin/ordered-set-37
Author: Xavier Bustamante
Author-email: xavier@bustawin.com
License: Unlicense
Project-URL: Documentation, https://github.com/bustawin/ordered-set-37
Project-URL: Code, https://github.com/bustawin/ordered-set-37
Project-URL: Issue tracker, https://github.com/bustawin/ordered-set-37/issues/
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Python: >=3.7
Provides-Extra: test
License-File: LICENSE.md

Ordered Set
###########
A dead simple set that preserves insertion order, internally using the
python's 3.7 dict, which preserves order.

``pip install ordered-set-37``

This class subclasses and implements all the methods of ``MutableSet``.

.. code-block:: python

   from ordered_set_37 import OrderedSet
   x = OrderedSet([1, 2, -1, "bar"])
   x.add(0)
   assert list(x) == [1, 2, -1, "bar", 0]


This library uses the typing system, so feel free to do:

.. code-block:: python

  x: OrderedSet[str] = OrderedSet(("foo", "bar"))
  x.add(1)  # type checkers won't like this as it is not a string



As an extra, you can access a value by index (although the speed is at worst O(n)):

.. code-block:: python

  x = OrderedSet(["foo", "bar", "baz"])
  assert x[1] == "bar"

For obvious reasons, this library is only Python 3.7+ compatible.

Feel free to contribute, fork, etc.
