get_instance_from_cache

getmac.getmac.get_instance_from_cache(method_type, method_name)[source]

Get the class for a named Method from the caches.

METHOD_CACHE is checked first, and if that fails, then any entries in FALLBACK_CACHE are checked. If both fail, None is returned.

Parameters:
  • method_type (str) – what cache should be checked. Allowed values are: ip4 | ip6 | iface | default_iface

  • method_name (str) – name of the method to look for

Return type:

Optional[Method]

Returns:

The cached method, or None if the method was not found