Setting

class Setting(key: str, factory_value: Any, value_type: type, description: str)[source]

Bases: object

A class representing a single configuration setting.

key

The name/identifier of the setting.

Type:

str

value

The current default value of the setting.

Type:

Any

value_type

The full declared type of the value. Can be a simple type (int, float, str, an enum subclass) or a generic list type (list[int], list[str], list[Active]).

Type:

type

description

A description of what the setting controls.

Type:

str

base_type

The outer/container type extracted from value_type. For simple types this equals value_type itself; for generic lists it is list.

Type:

type

element_type

For list settings, the type of each element (e.g. int for list[int], Active for list[Active]). None for non-list settings.

Type:

type | None

__init__(key: str, factory_value: Any, value_type: type, description: str) None[source]

Initialize a new Setting.

Parameters:
  • key (str) – The name of the setting.

  • factory_value (Any) – The default value. For enums, this is the string representation.

  • value_type (type) – The full declared type. Can be a simple type (int, float, str, an enum subclass) or a generic list type (list[int], list[Active], etc.).

  • description (str) – A brief description of the setting.

Methods