def _is_same_type_as_root(self, obj):
        """
        Testing if we try to collect an object of the same type as root.
        This is not really a good sign, because it means that we are going to collect a whole new tree, that will
        maybe collect a new tree, that will...
        """
        if not self.ALLOWS_SAME_TYPE_AS_ROOT_COLLECT:
            obj_model = get_model_from_instance(obj)
            obj_key = get_key_from_instance(obj)
            is_same_type_as_root = obj_model == self.root_obj_model and obj_key != self.root_obj_key

            if is_same_type_as_root:
                self.emit_event(type='same_type_as_root', obj=obj)

            return is_same_type_as_root
        else:
            return False
def _is_same_type_as_root ( self , obj ) : if not self . ALLOWS_SAME_TYPE_AS_ROOT_COLLECT : obj_model = get_model_from_instance ( obj ) obj_key = get_key_from_instance ( obj ) is_same_type_as_root = obj_model == self . root_obj_model and obj_key != self . root_obj_key if is_same_type_as_root : self . emit_event ( type = 'same_type_as_root' , obj = obj ) return is_same_type_as_root else : return False
Testing if we try to collect an object of the same type as root.
        This is not really a good sign, because it means that we are going to collect a whole new tree, that will
        maybe collect a new tree, that will...