Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)

src/x/o/xoutil-1.5.4/tests/test_collections.py   xoutil(Download)
def test_stacked_dict():
    from xoutil.collections import StackedDict
    sd = StackedDict(a='level-0')
    assert sd.peek() == dict(a='level-0')
    sd.push(a=1, b=2, c=10)
    assert sd.level == 1
    assert sd.peek() == dict(a=1, b=2, c=10)
    sd.push(b=4, c=5)
    assert sd.peek() == dict(b=4, c=5)