Skip to content

bases

Classes:

Attributes:

yaml_Loader module-attribute

yaml_Loader = SaferLoader

AbstractYAMLObjectMeta

AbstractYAMLObjectMeta(name: str, bases: tuple[type, ...], dct: dict[str, Any])

Bases: SafeYAMLObjectMetaclass, ABCMeta

Source code
79
80
81
def __init__(cls: type[T], name: str, bases: tuple[type, ...], dct: dict[str, Any]) -> None:
    super(SafeYAMLObjectMetaclass, cls).__init__(name, bases, dct)   # type: ignore
    yaml_Loader.add_constructor(f'tag:yaml.org,2002:python/object:{cls.__module__}.{cls.__name__}', cls.from_yaml)

AbstractYAMLObjectMetaClass

Bases: YAMLObject

AbstractYAMLObjectSingleton

AbstractYAMLObjectSingletonMeta

AbstractYAMLObjectSingletonMeta(
    name: str, bases: tuple[type, ...], dct: dict[str, Any]
)

Bases: SingletonMeta, AbstractYAMLObjectMeta

Methods:

Source code
44
45
46
47
48
def __init__(cls: type[T], name: str, bases: tuple[type, ...], dct: dict[str, Any]) -> None:
    super().__init__(name, bases, dct)  # type: ignore
    # store the instance in a list rather than directly as a member because otherwise this crashes
    # with PyQt6 on Python 3.12 for reasons I do not pretend to understand
    cls.instance: list[T] = []  # type: ignore

__call__

__call__(*args: Any, **kwargs: Any) -> T
Source code
50
51
52
53
def __call__(cls, *args: Any, **kwargs: Any) -> T:  # type: ignore
    if not cls.instance:
        cls.instance.append(super().__call__(*args, **kwargs))
    return cls.instance[0]

QABC

QABCMeta

Bases: wrappertype, ABCMeta

QAbstractYAMLObjectSingleton

QAbstractYAMLObjectSingletonMeta

QAbstractYAMLObjectSingletonMeta(
    name: str, bases: tuple[type, ...], dct: dict[str, Any]
)

Bases: QYAMLObjectSingletonMeta

Methods:

Source code
44
45
46
47
48
def __init__(cls: type[T], name: str, bases: tuple[type, ...], dct: dict[str, Any]) -> None:
    super().__init__(name, bases, dct)  # type: ignore
    # store the instance in a list rather than directly as a member because otherwise this crashes
    # with PyQt6 on Python 3.12 for reasons I do not pretend to understand
    cls.instance: list[T] = []  # type: ignore

__call__

__call__(*args: Any, **kwargs: Any) -> T
Source code
50
51
52
53
def __call__(cls, *args: Any, **kwargs: Any) -> T:  # type: ignore
    if not cls.instance:
        cls.instance.append(super().__call__(*args, **kwargs))
    return cls.instance[0]

QSingletonMeta

QSingletonMeta(name: str, bases: tuple[type, ...], dct: dict[str, Any])

Bases: SingletonMeta, wrappertype

Methods:

Source code
44
45
46
47
48
def __init__(cls: type[T], name: str, bases: tuple[type, ...], dct: dict[str, Any]) -> None:
    super().__init__(name, bases, dct)  # type: ignore
    # store the instance in a list rather than directly as a member because otherwise this crashes
    # with PyQt6 on Python 3.12 for reasons I do not pretend to understand
    cls.instance: list[T] = []  # type: ignore

__call__

__call__(*args: Any, **kwargs: Any) -> T
Source code
50
51
52
53
def __call__(cls, *args: Any, **kwargs: Any) -> T:  # type: ignore
    if not cls.instance:
        cls.instance.append(super().__call__(*args, **kwargs))
    return cls.instance[0]

QYAMLObject

Bases: YAMLObject

QYAMLObjectMeta

QYAMLObjectMeta(name: str, bases: tuple[type, ...], dct: dict[str, Any])

Bases: SafeYAMLObjectMetaclass, wrappertype

Source code
79
80
81
def __init__(cls: type[T], name: str, bases: tuple[type, ...], dct: dict[str, Any]) -> None:
    super(SafeYAMLObjectMetaclass, cls).__init__(name, bases, dct)   # type: ignore
    yaml_Loader.add_constructor(f'tag:yaml.org,2002:python/object:{cls.__module__}.{cls.__name__}', cls.from_yaml)

QYAMLObjectSingleton

QYAMLObjectSingletonMeta

QYAMLObjectSingletonMeta(
    name: str, bases: tuple[type, ...], dct: dict[str, Any]
)

Bases: QSingletonMeta, QYAMLObjectMeta

Methods:

Source code
44
45
46
47
48
def __init__(cls: type[T], name: str, bases: tuple[type, ...], dct: dict[str, Any]) -> None:
    super().__init__(name, bases, dct)  # type: ignore
    # store the instance in a list rather than directly as a member because otherwise this crashes
    # with PyQt6 on Python 3.12 for reasons I do not pretend to understand
    cls.instance: list[T] = []  # type: ignore

__call__

__call__(*args: Any, **kwargs: Any) -> T
Source code
50
51
52
53
def __call__(cls, *args: Any, **kwargs: Any) -> T:  # type: ignore
    if not cls.instance:
        cls.instance.append(super().__call__(*args, **kwargs))
    return cls.instance[0]

SafeYAMLObject

Bases: YAMLObject

SafeYAMLObjectMetaclass

SafeYAMLObjectMetaclass(
    name: str, bases: tuple[type, ...], dct: dict[str, Any]
)

Bases: YAMLObjectMetaclass

Source code
79
80
81
def __init__(cls: type[T], name: str, bases: tuple[type, ...], dct: dict[str, Any]) -> None:
    super(SafeYAMLObjectMetaclass, cls).__init__(name, bases, dct)   # type: ignore
    yaml_Loader.add_constructor(f'tag:yaml.org,2002:python/object:{cls.__module__}.{cls.__name__}', cls.from_yaml)

SaferLoader

Bases: SafeLoader

Methods:

compose_node

compose_node(parent, index)
Source code
31
32
33
34
35
36
37
38
def compose_node(self, parent, index):
    if self.check_event(AliasEvent):
        event = self.peek_event()
        anchor = event.anchor
        if anchor not in self.anchors:
            self.get_event()
            return ScalarNode("tag:yaml.org,2002:null", "null")
    return super().compose_node(parent, index)

Singleton

SingletonMeta

SingletonMeta(name: str, bases: tuple[type, ...], dct: dict[str, Any])

Bases: type

Methods:

Source code
44
45
46
47
48
def __init__(cls: type[T], name: str, bases: tuple[type, ...], dct: dict[str, Any]) -> None:
    super().__init__(name, bases, dct)  # type: ignore
    # store the instance in a list rather than directly as a member because otherwise this crashes
    # with PyQt6 on Python 3.12 for reasons I do not pretend to understand
    cls.instance: list[T] = []  # type: ignore

__call__

__call__(*args: Any, **kwargs: Any) -> T
Source code
50
51
52
53
def __call__(cls, *args: Any, **kwargs: Any) -> T:  # type: ignore
    if not cls.instance:
        cls.instance.append(super().__call__(*args, **kwargs))
    return cls.instance[0]