(self, namespace, identifier, obj)
Checks a proposed identifier's validity before assigning to an object.
Checks a proposed identifier's validity before assigning to an object.
Checks a proposed identifier s validity before assigning to an object .
def _assign(self, namespace, identifier, obj):
    """Checks a proposed identifier's validity before assigning to an object."""
    namespace_dict = self._namespaces[namespace]
    if not isinstance(identifier, str):
      raise ValueError(
          'Identifier must be a string: got {}'.format(type(identifier)))
    elif constants.PREFIX_SEPARATOR in identifier:
      raise ValueError(
          'Identifier cannot contain {!r}: got {}'
          .format(constants.PREFIX_SEPARATOR, identifier))
    else:
      namespace_dict[identifier] = obj
def _assign ( self , namespace , identifier , obj ) : namespace_dict = self . _namespaces [ namespace ] if not isinstance ( identifier , str ) : raise ValueError ( 'Identifier must be a string: got {}' . format ( type ( identifier ) ) ) elif constants . PREFIX_SEPARATOR in identifier : raise ValueError ( 'Identifier cannot contain {!r}: got {}' . format ( constants . PREFIX_SEPARATOR , identifier ) ) else : namespace_dict [ identifier ] = obj