ssllabs.util

ssllabs.util.objectornone(type, data, key)[source]

conditionally returns type(data[key]), or None.

Checks data for key, returning a type object constructed with the value if it exists.

Parameters:
  • type (type) – the type to be constructed from data[key]
  • data (dict) – the data to use to construct the type object
  • key (str) – the key to search for in data
Returns:

the type object, or None

Return type:

the type contained in type, or NoneType