Dictionary with case-insensitive keys
Project description
dicti is a dictionary with case-insensitive keys.
It works like the normal dict except that key matching is case-insensitive.
Instantiate like you would instantiate a normal dict; for example, these work.
dict(foo = ‘bar’, answer = 42) dicti(foo = ‘bar’, answer = 42)
dict({‘foo’: ‘bar’, ‘answer’: 42}) dicti({‘foo’: ‘bar’, ‘answer’: 42})
Methods that accept keys and have side-effects record the original case, just as a normal dictionary does.
di = dicti() di[‘cAsE’] = 1 di.keys() == [‘cAsE’] di[‘Case’] = 1 di.keys() == [‘Case’] di[‘caSE’] == 1
Methods that accept keys do the same thing regardless of what case you pass the key in.
Keys are still stored in their original case, however; the original keys are presented when you request them with methods like dicti.keys.
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
File details
Details for the file dicti-0.0.1.tar.gz
.
File metadata
- Download URL: dicti-0.0.1.tar.gz
- Upload date:
- Size: 15.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9e821019d293586cab522d7cf0d1e85c11e6f0e4c5085e0890241f9b96b7b28 |
|
MD5 | 682ae3379a387b916abff5032787d973 |
|
BLAKE2b-256 | 7d0144ccb0bd4a711c12576771b478f5dada512906ffa58f93e22d5191259d3e |