class_docstr: Create a set of config values, optionally pre-filled with values from
  the given dictionary or pre-existing config object.
  
  The class implements the MutableMapping protocol keyed by option name (`str`).
  For convenience its methods accept either Option or str as the key parameter.
  
  .. seealso:: :meth:`set()`
  
  This config class is abstract because it needs its ``options`` class
  var to be set to an instance of :class:`Options` before it can be
  instanciated and used.
  
  .. code:: python
  
      class MyConfig(AbstractConfig):
          options = Options()
  
      MyConfig.register_option( "test:option_name", "This is an option", 0, int, lambda v: isinstance(v, int))
  
      cfg = MyConfig({"test:option_name": 10})
class_docstr_tok: ["Create","a","set","of","config","values",",","optionally","pre-filled","with","values","from","the","given","dictionary","or","pre-existing","config","object",".","The","class","implements","the","MutableMapping","protocol","keyed","by","option","name","(","`","str","`",")",".","For","convenience","its","methods","accept","either","Option","or","str","as","the","key","parameter",".","..","seealso",":",":",":","meth",":","`","set","(",")","`","This","config","class","is","abstract","because","it","needs","its","``","options","``","class","var","to","be","set","to","an","instance","of",":","class",":","`","Options","`","before","it","can","be","instanciated","and","used",".","..","code",":",":","python","class","MyConfig","(","AbstractConfig",")",":","options","=","Options","(",")","MyConfig.register_option","(","``","test",":","option_name","''",",","``","This","is","an","option","''",",","0",",","int",",","lambda","v",":","isinstance","(","v",",","int",")",")","cfg","=","MyConfig","(","{","``","test",":","option_name","''",":","10","}",")"]
docstr: Set the value of an option.
  
  Args:
      * `option_or_name`: an `Option` object or its name (`str`).
      * `value`: the value to be assigned to given option.
      * `parse_values`: parse the configuration value from a string into
          its proper type, as per its `Option` object. The default
          behavior is to raise `ConfigValueValidationError` when the value
          is not of the right type. Useful when reading options from a
          file type that doesn't support as many types as Python.
      * `skip_unknown`: skip unknown configuration options. The default
          behaviour is to raise `ConfigUnknownOptionError`. Useful when
          reading options from a configuration file that has extra entries
          (e.g. for a later version of fontTools)
docstr_tok: ["Set","the","value","of","an","option",".","Args",":","*","`","option_or_name","`",":","an","`","Option","`","object","or","its","name","(","`","str","`",")",".","*","`","value","`",":","the","value","to","be","assigned","to","given","option",".","*","`","parse_values","`",":","parse","the","configuration","value","from","a","string","into","its","proper","type",",","as","per","its","`","Option","`","object",".","The","default","behavior","is","to","raise","`","ConfigValueValidationError","`","when","the","value","is","not","of","the","right","type",".","Useful","when","reading","options","from","a","file","type","that","does","n't","support","as","many","types","as","Python",".","*","`","skip_unknown","`",":","skip","unknown","configuration","options",".","The","default","behaviour","is","to","raise","`","ConfigUnknownOptionError","`",".","Useful","when","reading","options","from","a","configuration","file","that","has","extra","entries","(","e.g",".","for","a","later","version","of","fontTools",")"]
code: def set(
      self,
      option_or_name: Union[Option, str],
      value: Any,
      parse_values: bool = False,
      skip_unknown: bool = False,
  ):
      """Set the value of an option.
  
      Args:
          * `option_or_name`: an `Option` object or its name (`str`).
          * `value`: the value to be assigned to given option.
          * `parse_values`: parse the configuration value from a string into
              its proper type, as per its `Option` object. The default
              behavior is to raise `ConfigValueValidationError` when the value
              is not of the right type. Useful when reading options from a
              file type that doesn't support as many types as Python.
          * `skip_unknown`: skip unknown configuration options. The default
              behaviour is to raise `ConfigUnknownOptionError`. Useful when
              reading options from a configuration file that has extra entries
              (e.g. for a later version of fontTools)
      """
      try:
          option = self._resolve_option(option_or_name)
      except ConfigUnknownOptionError as e:
          if skip_unknown:
              log.debug(str(e))
              return
          raise
  
      # Can be useful if the values come from a source that doesn't have
      # strict typing (.ini file? Terminal input?)
      if parse_values:
          try:
              value = option.parse(value)
          except Exception as e:
              raise ConfigValueParsingError(option.name, value) from e
  
      if option.validate is not None and not option.validate(value):
          raise ConfigValueValidationError(option.name, value)
  
      self._values[option.name] = value
  
imports: from __future__ import annotations
  import logging
  from dataclasses import dataclass
  from typing import Any, Callable, ClassVar, Dict, Iterable, Mapping, MutableMapping, Optional, Set, Union
label_desc: Use image node_id 4 for calling the AbstractConfig obj's underlying member method code with example usage: obj.set(option_or_name, value, parse_values, skip_unknown) without return types