Determine if the object is an immutable object. see also https://github.com/python/cpython/blob/3.11/Lib/copy.py#L109
(obj: Any)
| 155 | |
| 156 | |
| 157 | def is_immutable(obj: Any) -> bool: |
| 158 | """ |
| 159 | Determine if the object is an immutable object. |
| 160 | |
| 161 | see also https://github.com/python/cpython/blob/3.11/Lib/copy.py#L109 |
| 162 | """ |
| 163 | return isinstance(obj, (type(None), int, float, bool, complex, str, tuple, bytes, type, range, slice)) |
| 164 | |
| 165 | |
| 166 | def ensure_tuple(vals: Any, wrap_array: bool = False) -> tuple: |
no outgoing calls
no test coverage detected
searching dependent graphs…