def _compute_id(self, obj): if self.is_in_nursery(obj): result = self.young_objects_with_id.get(obj) if not result: result = self._next_id() self.young_objects_with_id.setitem(obj, result) return result else: return SemiSpaceGC._compute_id(self, obj)