Skip to main content

polist, partially ordered list

Project description

polist, partially ordered list
=========

.. sourcecode:: python

>>> from polist import PartialOrderedList
>>> p = PartialOrderedList()
>>> p.append(0, 'A')
>>> p.append(1, 'B')
>>> p.append(2, 'A')
>>> p
[0, 1, 2]
>>> assert [0, 1, 2] == p
>>> assert [2, 1, 0] == p
>>> assert [0, 2, 1] != p
>>> assert [1, 0, 2] != p
>>> assert [1, 2, 0] != p
>>> assert [2, 0, 1] != p

>>> p = PartialOrderedList()
>>> p.append(0, 'A')
>>> p.append(1, 'A')
>>> p.append(2, 'B')
>>> p.append(3, 'B')
>>> p.append(4, 'C')
>>> p.append(5, 'C')
>>> p
[0, 1, 2, 3, 4, 5]
>>> assert [0, 1, 2, 3, 4, 5] == p
>>> assert [0, 1, 3, 2, 4, 5] == p
>>> assert [1, 0, 2, 3, 4, 5] == p
>>> assert [1, 0, 3, 2, 4, 5] == p
>>> assert [0, 1, 2, 3, 5, 4] == p
>>> assert [0, 1, 3, 2, 5, 4] == p
>>> assert [1, 0, 2, 3, 5, 4] == p
>>> assert [1, 0, 3, 2, 5, 4] == p

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for polist, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size polist-0.0.2.macosx-10.9-intel.tar.gz (3.1 kB) File type Dumb Binary Python version any Upload date Hashes View
Filename, size polist-0.0.2-py2.7.egg (4.3 kB) File type Egg Python version 2.7 Upload date Hashes View
Filename, size polist-0.0.2.tar.gz (2.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page