Code and Notes for Python Language.
-
AttrDict
: a mapping that allows attribute-style access, key-style access, and double star**
unpacking.- Usage:
from dictionary import AttrDict d = AttrDict(a = 1, b = 2) assert d.a == d['a']
- Usage:
-
Show
: Compactly display the structure of an arbitrary object, like a dict, a list, etc.- Usage:
from structure import Show x = {i: list(range(100)) for i in range(100)} show = Show(max_len=10, indent='..') show(x)
- Usage: