A convenience function which pops a key k from source to dest. None values are not passed on. If k already exists in dest an error is raised.
(
source: MutableMapping, dest: MutableMapping, key: Hashable, name: T_Name = None
)
| 122 | |
| 123 | |
| 124 | def pop_to( |
| 125 | source: MutableMapping, dest: MutableMapping, key: Hashable, name: T_Name = None |
| 126 | ) -> Any: |
| 127 | """ |
| 128 | A convenience function which pops a key k from source to dest. |
| 129 | None values are not passed on. If k already exists in dest an |
| 130 | error is raised. |
| 131 | """ |
| 132 | value = source.pop(key, None) |
| 133 | if value is not None: |
| 134 | safe_setitem(dest, key, value, name=name) |
| 135 | return value |
| 136 | |
| 137 | |
| 138 | def unpack_for_encoding(var: Variable) -> T_VarTuple: |
no test coverage detected
searching dependent graphs…