Base class for chaining DBs (regolith.chained_db)

Base class for chaining DBs

ChainDBSingleton Copyright 2015-2016, the xonsh developers

class regolith.chained_db.ChainDB(*maps)[source]

A ChainMap who’s _getitem__ returns either a ChainDB or the result

clear()

Clear maps[0], leaving maps[1:] intact.

copy()

New ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]

classmethod fromkeys(iterable, *args)

Create a ChainMap with a single dict created from the iterable.

get(k[, d]) D[k] if k in D, else d.  d defaults to None.
items() a set-like object providing a view on D's items
keys() a set-like object providing a view on D's keys
new_child(m=None, **kwargs)

New ChainMap with a new map followed by all previous maps. If no map is provided, an empty dict is used. Keyword arguments update the map or new empty dict.

property parents

].

Type:

New ChainMap from maps[1

pop(key, *args)

Remove key from maps[0] and return its value. Raise KeyError if key not in maps[0].

popitem()

Remove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.

setdefault(k[, d]) D.get(k,d), also set D[k]=d if k not in D
update([E, ]**F) None.  Update D from mapping/iterable E and F.

If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v

values() an object providing a view on D's values
class regolith.chained_db.ChainDBSingleton[source]

Singleton for representing when no default value is given.