Skip to main content

Python implementation of a polymorphic list

Project description

py-polymorphic-list

Publish to PyPI Deploy docs to GitHub Pages

Python implementation of a polymorphic list

View on PyPI / Documentation / GitHub Source Code

What is a Polymorphic List?

A polymorphic list is a data abstraction similar to LinkedLists where objects of two classes, NonEmptyList, and EmptyList, are employed to cleanly handle edge cases where a LinkedList would be null. In a LinkedList, the last node's next reference is null; however, for a PolymorphicList, the last node's next reference is an EmptyList, allowing the EmptyList object to override methods defined in a PolymorphicList.

This means that every method is overridden to have a version for a NonEmptyList and for an EmptyList.

Installation

pip install py-polymorphic-list

Or install with pip3, accordingly.

Documentation

Check out the documentation for full details on usage.

Project details


Download files

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

Source Distribution

py_polymorphic_list-1.0.0.tar.gz (5.5 kB view hashes)

Uploaded Source

Built Distribution

py_polymorphic_list-1.0.0-py3-none-any.whl (5.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page