Skip to main content

HashList

This is a package for a list that can display the minimal differences between instances of this type.

This is best demonstrated with Python's go-to metasyntatic values:

menu = [
    HashList(['egg', 'bacon']),
    HashList(['egg', 'sausage', 'bacon']),
    HashList(['egg', 'spam']),
    HashList(['egg', 'bacon', 'spam']),
    HashList(['egg', 'bacon', 'sausage', 'spam']),
    HashList(['spam', 'bacon', 'sausage', 'spam']),
    HashList(['spam', 'egg', 'spam', 'spam', 'bacon', 'spam']),
    HashList(['spam', 'spam', 'spam', 'egg', 'spam']),
    HashList(['spam', 'spam', 'spam', 'spam', 'spam', 'spam', 'baked beans', 'spam', 'spam', 'spam', 'spam']),
    HashList(['lobster thermidor aux crevettes with a mornay sauce, garnished with truffle pâté and a fried egg on top', 'spam'])
]

# Header
end = ', '
for i in range(len(menu)):
    if i == len(menu) - 1:
        end = ': '
    print('Combo {}'.format(i), end=end)
print("Item")
print("-" * 100)

# Table of indicies
for entry in menu[0].diff(menu[1:]):
    end = ', '
    for i in range(len(entry['matches'])):
        match = entry['matches'][i]
        if i == len(entry['matches']) - 1:
            end = ': '
        print('{!r:>7}'.format(match), end=end)
    print(entry['item'])

Output:

Combo 0, Combo 1, Combo 2, Combo 3, Combo 4, Combo 5, Combo 6, Combo 7, Combo 8, Combo 9: Item
----------------------------------------------------------------------------------------------------
      0,       0,       0,       0,       0,    None,       1,       3,    None,    None: egg
      1,       2,    None,       1,       1,       1,       4,    None,    None,    None: bacon
   None,       1,    None,    None,       2,       2,    None,    None,    None,    None: sausage
   None,    None,       1,       2,       3,       0,       0,       0,       0,       1: spam
   None,    None,    None,    None,    None,       3,       2,       1,       1,    None: spam
   None,    None,    None,    None,    None,    None,       3,       2,       2,    None: spam
   None,    None,    None,    None,    None,    None,       5,       4,       3,    None: spam
   None,    None,    None,    None,    None,    None,    None,    None,       4,    None: spam
   None,    None,    None,    None,    None,    None,    None,    None,       5,    None: spam
   None,    None,    None,    None,    None,    None,    None,    None,       6,    None: baked beans
   None,    None,    None,    None,    None,    None,    None,    None,       7,    None: spam
   None,    None,    None,    None,    None,    None,    None,    None,       8,    None: spam
   None,    None,    None,    None,    None,    None,    None,    None,       9,    None: spam
   None,    None,    None,    None,    None,    None,    None,    None,      10,    None: spam
   None,    None,    None,    None,    None,    None,    None,    None,    None,       0: lobster thermidor aux crevettes with a mornay sauce, garnished with truffle pâté and a fried egg on top

Release files for hashlist-NickNackGus 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hashlist-NickNackGus 1.0.0
File Size Uploaded
hashlist-NickNackGus-1.0.0.tar.gz 3.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hashlist-NickNackGus 1.0.0
File Interpreter ABI Platform
hashlist_NickNackGus-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size:7.3 kB

Release files / hashlist-NickNackGus-1.0.0.tar.gz

Download URL hashlist-NickNackGus-1.0.0.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
60c465994b49fd14a536c5460f959a154942e43e7f13bc2c2c578ed158847934
BLAKE2b-256 checksum
How to use checksums
fcb790484c79f04b74276817d6db43fa1b6cbb9e14b8c004fc648be32d7f422b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.9.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.5.2

Release files / hashlist_NickNackGus-1.0.0-py3-none-any.whl

Download URL hashlist_NickNackGus-1.0.0-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
19dfef579f06e97ea94b88f8cd0ab8872f672b277873ee6fc7b62c288207c034
BLAKE2b-256 checksum
How to use checksums
acfce82421bb3688d32afa78b93a9caef40fcd6808ddd044da2000b4f12c0487
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.9.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.5.2

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page