Copy the given dict and update with the given values.
(
d: Dict[Any, Any], _new: Optional[Dict[Any, Any]] = None, **kw: Any
)
| 426 | |
| 427 | |
| 428 | def update_copy( |
| 429 | d: Dict[Any, Any], _new: Optional[Dict[Any, Any]] = None, **kw: Any |
| 430 | ) -> Dict[Any, Any]: |
| 431 | """Copy the given dict and update with the given values.""" |
| 432 | |
| 433 | d = d.copy() |
| 434 | if _new: |
| 435 | d.update(_new) |
| 436 | d.update(**kw) |
| 437 | return d |
| 438 | |
| 439 | |
| 440 | def flatten_iterator(x: Iterable[_T]) -> Iterator[_T]: |