Skip to main content

Little bit better than dict

Project description

Description

Like dict, but a little bit better

install

  pip install dictones

import

from dictones import DictOnes

Usage

1. Added constructor

  filled_dict = DictOnes('first_key, second_key', 'to first key', 'to second key')
  print(filled_dict.first_key)
  print(filled_dict.second_key)

Output

'to first key'
'to second_key'

2. Constructor without filling

  filled_dict = DictOnes('first_key, second_key')
  print(filled_dict.first_key)
  print(filled_dict.second_key)
  print(filled_dict.key)

Output

None
None
...raise KeyError(attrname)
KeyError: 'key'

3. Deleting

filled_dict = DictOnes('first_key, second_key')
print(filled_dict.first_key)
print(filled_dict.second_key)
print('second_key' in filled_dict)
del filled_dict.second_key
print('second_key' in filled_dict)

Output

None
None
True
False

Otherwise it is the same dict

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

dictones-0.1.1.tar.gz (24.8 kB view details)

Uploaded Source

Built Distribution

dictones-0.1.1-py3-none-any.whl (35.3 kB view details)

Uploaded Python 3

File details

Details for the file dictones-0.1.1.tar.gz.

File metadata

  • Download URL: dictones-0.1.1.tar.gz
  • Upload date:
  • Size: 24.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.9.1 Windows/10

File hashes

Hashes for dictones-0.1.1.tar.gz
Algorithm Hash digest
SHA256 47aa8b718c4ddfa2bece403cafb44dd13e375c2396f1da4615fa32ec714d97ff
MD5 a39b0c5f4d9cd1afd205e204b2a74bb8
BLAKE2b-256 a227b72bfcf00e55dde69aaf7df98ec373a0dab6b1c8bd27b5702b4f38ce5f3a

See more details on using hashes here.

Provenance

File details

Details for the file dictones-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: dictones-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 35.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.9.1 Windows/10

File hashes

Hashes for dictones-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5c982e651629824fe7bf7a9044df569d390f441fd272872cde5a11dee19dec0f
MD5 1e66d84f715f54d5abfe68f3320c8c02
BLAKE2b-256 dbe5a9b11421081354af344728c94eb32f7c0ddd2b9f1cc04a0a40925042ecf8

See more details on using hashes here.

Provenance

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