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: Get the value of an option. The value which is returned is the first
  provided among:
  
  1. a user-provided value in the options's ``self._values`` dict
  2. a caller-provided default value to this method call
  3. the global default for the option provided in ``fontTools.config``
  
  This is to provide the ability to migrate progressively from config
  options passed as arguments to fontTools APIs to config options read
  from the current TTFont, e.g.
  
  .. code:: python
  
      def fontToolsAPI(font, some_option):
          value = font.cfg.get("someLib.module:SOME_OPTION", some_option)
          # use value
  
  That way, the function will work the same for users of the API that
  still pass the option to the function call, but will favour the new
  config mechanism if the given font specifies a value for that option.
docstr_tok: ["Get","the","value","of","an","option",".","The","value","which","is","returned","is","the","first","provided","among",":","1.","a","user-provided","value","in","the","options","'s","``","self._values","``","dict","2.","a","caller-provided","default","value","to","this","method","call","3.","the","global","default","for","the","option","provided","in","``","fontTools.config","``","This","is","to","provide","the","ability","to","migrate","progressively","from","config","options","passed","as","arguments","to","fontTools","APIs","to","config","options","read","from","the","current","TTFont",",","e.g",".","..","code",":",":","python","def","fontToolsAPI","(","font",",","some_option",")",":","value","=","font.cfg.get","(","``","someLib.module",":","SOME_OPTION","''",",","some_option",")","#","use","value","That","way",",","the","function","will","work","the","same","for","users","of","the","API","that","still","pass","the","option","to","the","function","call",",","but","will","favour","the","new","config","mechanism","if","the","given","font","specifies","a","value","for","that","option","."]
code: def get(
      self,
      option_or_name: Union[Option, str],
      default: Any = _USE_GLOBAL_DEFAULT,
  ) -> Any:
      """
      Get the value of an option. The value which is returned is the first
      provided among:
  
      1. a user-provided value in the options's ``self._values`` dict
      2. a caller-provided default value to this method call
      3. the global default for the option provided in ``fontTools.config``
  
      This is to provide the ability to migrate progressively from config
      options passed as arguments to fontTools APIs to config options read
      from the current TTFont, e.g.
  
      .. code:: python
  
          def fontToolsAPI(font, some_option):
              value = font.cfg.get("someLib.module:SOME_OPTION", some_option)
              # use value
  
      That way, the function will work the same for users of the API that
      still pass the option to the function call, but will favour the new
      config mechanism if the given font specifies a value for that option.
      """
      option = self._resolve_option(option_or_name)
      if option.name in self._values:
          return self._values[option.name]
      if default is not _USE_GLOBAL_DEFAULT:
          return default
      return option.default
  
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 5 for calling the AbstractConfig obj's underlying member method code with example usage: obj.get(option_or_name, default) and returns: option, self, default