(self, ref: weakref.ref[Type[Any]])
| 231 | return cls |
| 232 | |
| 233 | def _remove_item(self, ref: weakref.ref[Type[Any]]) -> None: |
| 234 | self.contents.discard(ref) |
| 235 | if not self.contents: |
| 236 | _registries.discard(self) |
| 237 | if self.on_remove: |
| 238 | self.on_remove() |
| 239 | |
| 240 | def add_item(self, item: Type[Any]) -> None: |
| 241 | # protect against class registration race condition against |