Skip to main content

dict replacement - attribute-style access, None instead of KeyError, safe remove

Project description

Install

github.com: pip install git+git://github.com/russianidiot/dict.py.git

pypi.python.org: pip install dict

download: python setup.py install or setup.py/.setup.py develop.command

Usage

from dict import *

dict(k="v")["k"]
>>> "v"
dict(k="v").k
>>> "v"
dict(k="v")["not_existing"]
>>> None
dict(k="v").not_existing
>>> None

dict(k="v").get("K",i=True) # case insensitive
>>> "v"

dict(k="v").remove("k").update(k2="v2") # jquery like chain

Tested: python 2.6, 2.7, 3+

Bug Tracker: github.com/russianidiot/dict.py/issues

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

dict-0.0.1.tar.gz (5.1 kB view hashes)

Uploaded Source

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