ihmwg / python-ihm

Python package for handling IHM mmCIF and BinaryCIF files
MIT License
14 stars 7 forks source link

Remove __hash__ from some/most classes #12

Open benmwebb opened 6 years ago

benmwebb commented 6 years ago

Many IHM classes are hashable, as we stick them in dict to detect copies. This is potentially problematic as the classes are also mutable, so users of the library may be tempted to place objects in their own set or dict, modify them, and end up with bizarre behavior. We should probably fix this by removing the __hash__ method from these classes and handling copies in some other fashion (e.g. a mutable wrapper class similar to frozenset vs. set).