MCPcopy Create free account
hub / github.com/EasyIME/PIME / set

Method set

python/python3/tornado/options.py:591–612  ·  view source on GitHub ↗
(self, value: Any)

Source from the content-addressed store, hash-verified

589 return self.value()
590
591 def set(self, value: Any) -> None:
592 if self.multiple:
593 if not isinstance(value, list):
594 raise Error(
595 "Option %r is required to be a list of %s"
596 % (self.name, self.type.__name__)
597 )
598 for item in value:
599 if item is not None and not isinstance(item, self.type):
600 raise Error(
601 "Option %r is required to be a list of %s"
602 % (self.name, self.type.__name__)
603 )
604 else:
605 if value is not None and not isinstance(value, self.type):
606 raise Error(
607 "Option %r is required to be a %s (%s given)"
608 % (self.name, self.type.__name__, type(value))
609 )
610 self._value = value
611 if self.callback is not None:
612 self.callback(self._value)
613
614 # Supported date/time formats in our options
615 _DATETIME_FORMATS = [

Callers 2

__setattr__Method · 0.45
parse_config_fileMethod · 0.45

Calls 3

ErrorClass · 0.85
typeEnum · 0.50
callbackMethod · 0.45

Tested by

no test coverage detected