class_docstr: Iterative lookup in a stack of dicts
  
  Assignments go into an internal dict that is also the first place
  where a lookup is done.
class_docstr_tok: ["Iterative","lookup","in","a","stack","of","dicts","Assignments","go","into","an","internal","dict","that","is","also","the","first","place","where","a","lookup","is","done","."]
code: def __getitem__(self, key):
      for d in self.stack:
          with suppress(KeyError):
              return d[key]
      raise KeyError(key)
  
imports: from __future__ import annotations
  from collections.abc import MutableMapping
  from contextlib import suppress
  from dataclasses import dataclass
  from functools import lru_cache
  from typing import TYPE_CHECKING
label_desc: Use image node_id 2 for calling the StackedLookup obj's underlying member method code with example usage: obj.__getitem__(key) and returns: d