4 | | That's a good question, because python offers no simple check a la `ismutable(x)`. It would be easy to just do a check like `isinstance(x, (bool, int, float, tuple, str, frozenset, decimal, complex, bytes))`, if you can live with the "danger" of users sub-classing those types and making them mutable. But I guess those can't be helped with this check. |
| 4 | That's a good question, because python offers no simple check a la `ismutable(x)`. It would be easy to just do an additional check like `isinstance(x, (bool, int, float, tuple, str, frozenset, decimal, complex, bytes))`, if you can live with the "danger" of users sub-classing those types and making them mutable. But I guess those can't be helped with this check. |