helpers.pysdc_helper module

class FrozenClass[source]

Bases: object

Helper class to freeze a class, i.e. to avoid adding more attributes

__isfrozen

Flag to freeze a class

classmethod add_attr(key, raise_error_if_exists=False)[source]

Add a key to the allowed attributes of this class.

Parameters:
  • key (str) – The key to add

  • raise_error_if_exists (bool) – Raise an error if the attribute already exists in the class

attrs = []
get(key, default=None)[source]

Wrapper for __dict__.get to use when reading variables that might not exist, depending on the configuration

Parameters:
  • key (str) – Name of the variable you wish to read

  • default – Value to be returned if the variable does not exist

Returns:

__dict__.get(key, default)