config.basic.sequence

序列类型配置数据实现

在 0.2.0 版本加入.

Classes

SequenceConfigData

序列配置数据

StringConfigData

字符/字节串配置数据

Module Contents

class SequenceConfigData[D: collections.abc.Sequence[Any]](data: D | None = None)

Bases: config.basic.core.BasicIndexedConfigData[D], collections.abc.MutableSequence[Any]

序列配置数据

在 0.1.5 版本加入.

参数:

data (D | None) -- 序列数据

__add__(other: Any) Self
__contains__(value)
abstractmethod __delitem__(index)
abstractmethod __getitem__(index)
__iadd__(values)
__iter__()
abstractmethod __len__()
__mul__(other: Any) Self
__radd__(other: Any) Self
__reversed__() collections.abc.Iterator[D]
__rmul__(other: Any) Self
abstractmethod __setitem__(index, value)
classmethod __subclasshook__(C)
append(value: Any) None

S.append(value) -- append value to the end of the sequence

clear() None

S.clear() -> None -- remove all items from S

count(value: Any) int

S.count(value) -> integer -- return number of occurrences of value

extend(values: collections.abc.Iterable[Any]) None

S.extend(iterable) -- extend sequence by appending elements from the iterable

index(*args: Any) int

S.index(value, [start, [stop]]) -> integer -- return first index of value. Raises ValueError if the value is not present.

Supporting start and stop arguments is optional, but recommended.

insert(index: int, value: Any) None

S.insert(index, value) -- insert value before index

pop(index: int = -1) Any

S.pop([index]) -> item -- remove and return item at index (default last). Raise IndexError if list is empty or index is out of range.

remove(value: Any) None

S.remove(value) -- remove first occurrence of value. Raise ValueError if the value is not present.

reverse() None

S.reverse() -- reverse IN PLACE

__abc_tpflags__ = 32
__class_getitem__
__slots__ = ()
_data: D
data: D
property data_read_only: bool
class StringConfigData[D: str | bytes](data: D | None = None)

Bases: config.basic.core.BasicSingleConfigData[D]

字符/字节串配置数据

参数:

data (D | None) -- 配置数据

__add__(other: Any) Self
__contains__(key: Any) bool
__delitem__(key: Any) None
__format__(format_spec: str) str
__getitem__(item: Any) D
__iter__() collections.abc.Iterator[D]
__len__() int
__mul__(other: Any) Self
__reversed__() Any
__setitem__(key: Any, value: D) None
_data: D
property data: D

配置的原始数据

小心

未默认做深拷贝,可能导致非预期的行为

在 0.3.0 版本发生变更: 现在是可写属性

property data_read_only: False

配置数据是否为只读

返回:

配置数据是否为只读

返回类型:

Literal[False]

备注

该配置数据类始终认为配置数据非只读,使其能正确作为配置数据容器使用