| 303 | assert copy(immutable) is immutable |
| 304 | |
| 305 | def test_dict_is_hashable(self): |
| 306 | cls = self.storage_class |
| 307 | immutable = cls({"a": 1, "b": 2}) |
| 308 | immutable2 = cls({"a": 2, "b": 2}) |
| 309 | x = {immutable} |
| 310 | assert immutable in x |
| 311 | assert immutable2 not in x |
| 312 | x.discard(immutable) |
| 313 | assert immutable not in x |
| 314 | assert immutable2 not in x |
| 315 | x.add(immutable2) |
| 316 | assert immutable not in x |
| 317 | assert immutable2 in x |
| 318 | x.add(immutable) |
| 319 | assert immutable in x |
| 320 | assert immutable2 in x |
| 321 | |
| 322 | def test_or(self) -> None: |
| 323 | a = self.storage_class({"x": 1}) |