class documentation

class PrivateDict(dict):

View In Hierarchy

A dictionary that turns its values to private fields.

>>> PrivateDict()
{}
>>> supersekkrit = PrivateDict({"password": "foobar"})
>>> print(supersekkrit["password"])
<password>
>>> supersekkrit["password"].Get()
'foobar'
>>> supersekkrit.GetPrivate("password")
'foobar'
>>> supersekkrit["user"] = "eggspam"
>>> supersekkrit.Unprivate()
{'password': 'foobar', 'user': 'eggspam'}
Method __init__ Undocumented
Method __setitem__ Undocumented
Method GetPrivate Like dict.get, but extracting the value in the process.
Method Unprivate Turn this dict of Private() values to a dict of values.
Method update Undocumented
def __init__(self, data=None):

Undocumented

def __setitem__(self, item, value):

Undocumented

def GetPrivate(self, *args):

Like dict.get, but extracting the value in the process.

Arguments are semantically equivalent to ``dict.get``

>>> PrivateDict({"foo": "bar"}).GetPrivate("foo")
'bar'
>>> PrivateDict({"foo": "bar"}).GetPrivate("baz", "spam")
'spam'
def Unprivate(self):

Turn this dict of Private() values to a dict of values.

>>> PrivateDict({"foo": "bar"}).Unprivate()
{'foo': 'bar'}
Returns
dictUndocumented
def update(self, other=None, **kwargs):

Undocumented