Python implementation of a polymorphic list
Project description
py-polymorphic-list
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
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
Built Distribution
Hashes for py_polymorphic_list-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a0c3dba6a9a4001050fa53159f3a5bc10835e2043c7f04488320898d379f36f |
|
MD5 | 0951841a97d4b88a2ae8f76e9fad1f1a |
|
BLAKE2b-256 | 242c4c015b5cb2dce8f85dd36d71611918e82a0effa4dbbdc14460e4bee67e55 |
Hashes for py_polymorphic_list-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26a9c4e93e84e62fa641d26a15e0c492cafc7e98f30da7d625e4026f0d0c835f |
|
MD5 | 21ff3a7df70fcd5fb4ce27f3acef48ca |
|
BLAKE2b-256 | 9156c76439a5e69236bc41cea42a497b279593d20889219a6f712e722a83fc59 |