def get(self, key: StashKey[T], default: D) -> T | D:
        """Get the value for key, or return default if the key wasn't set
        before."""
        try:
            return self[key]
        except KeyError:
            return default
Get the value for key, or return default if the key wasn't set
        before.
src/_pytest/stash.py