MCPcopy Create free account
hub / github.com/bpython/bpython / TrickyDict

Class TrickyDict

bpython/test/test_simpleeval.py:50–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48 simple_eval("a[1]", {"a": FakeDict()})
49
50 class TrickyDict(dict):
51 def __getitem__(self, index):
52 self.fail("doing key lookup isn't safe")
53
54 with self.assertRaises(ValueError):
55 simple_eval("a[1]", {"a": TrickyDict()})

Callers 1

Calls

no outgoing calls

Tested by 1