Delete ``name`` from dict. Raises ``KeyError`` if it doesn't exist, unless ``raising`` is set to False.
(self, dic: Mapping[K, V], name: K, raising: bool = True)
| 292 | dic[name] = value # type: ignore[index] |
| 293 | |
| 294 | def delitem(self, dic: Mapping[K, V], name: K, raising: bool = True) -> None: |
| 295 | """Delete ``name`` from dict. |
| 296 | |
| 297 | Raises ``KeyError`` if it doesn't exist, unless ``raising`` is set to |
| 298 | False. |
| 299 | """ |
| 300 | if name not in dic: |
| 301 | if raising: |
| 302 | raise KeyError(name) |
| 303 | else: |
| 304 | self._setitem.append((dic, name, dic.get(name, NOTSET))) |
| 305 | # Not all Mapping types support indexing, but MutableMapping doesn't support TypedDict |
| 306 | del dic[name] # type: ignore[attr-defined] |
| 307 | |
| 308 | def setenv(self, name: str, value: str, prepend: str | None = None) -> None: |
| 309 | """Set environment variable ``name`` to ``value``. |