Skip to main content

Dynamic Dictionary Class

Project description

DynDict

Python test PyPI - Downloads

Dynamic Dictionary class for Python adds support for add operation for dictionary classes.

Demo

Python 3.8.3 (default, May 17 2020, 18:15:42) 
[GCC 10.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from dyndict import dyndict
>>> dyn = dyndict()
>>> dyn
{}
>>> dyn += {'a': 1}
>>> dyn
{'a': 1}
>>> dyn += {'b': 1}
>>> dyn
{'a': 1, 'b': 1}
>>> dyn += {'b': 1}
>>> dyn
{'a': 1, 'b': 2}
>>> dyn += {'list': []}
>>> dyn
{'a': 1, 'b': 2, 'list': []}
>>> dyn += {'list': [1, 2, 3]}
>>> dyn
{'a': 1, 'b': 2, 'list': [1, 2, 3]}
>>> dyn += {'list': [{'z': 26}]}
>>> dyn
{'a': 1, 'b': 2, 'list': [1, 2, 3, {'z': 26}]}
>>> dyn['a']
1
>>> dyn['list'][3]
{'z': 26}

Installation

pip install dyndict

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

dyndict-20.7.3.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

dyndict-20.7.3-py3-none-any.whl (4.1 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