Changes between Initial Version and Version 1 of Ticket #34435, comment 6


Ignore:
Timestamp:
Apr 17, 2023, 4:53:26 AM (19 months ago)
Author:
Tobias Krönke

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #34435, comment 6

    initial v1  
    22> Can you suggest what changes should be done?
    33
    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))`, 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.
     4That'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.
Back to Top