From 8515106a0e0899ef96a9df04c72fbdb70623c529 Mon Sep 17 00:00:00 2001 From: KG Date: Tue, 12 Sep 2023 20:50:58 -0400 Subject: [PATCH] Add data converter docs --- tivars/data.py | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/tivars/data.py b/tivars/data.py index 771f8e7..ca26e54 100644 --- a/tivars/data.py +++ b/tivars/data.py @@ -74,6 +74,14 @@ def set(cls, value: _T, **kwargs) -> bytes: class Data(Bytes): + """ + No-op converter for data sections with associated metadata + + The following metadata fields are automatically set by this converter: + + - Version + """ + _T = bytes @classmethod @@ -81,12 +89,6 @@ def set(cls, value: _T, *, instance=None, **kwargs) -> _T: """ Converts ``bytes`` -> ``bytes`` and updates metadata fields - Certain metadata fields are updated automatically based on the entry's data. - The following are set by this converter: - - - Version - - Length (for sized data) - :param value: The value to convert :param instance: The instance which contains the data section :return: The bytes in ``value``, unchanged @@ -97,6 +99,15 @@ def set(cls, value: _T, *, instance=None, **kwargs) -> _T: class SizedData(Data): + """ + No-op converter for sized data sections with associated metadata + + The following metadata fields are automatically set by this converter: + + - Version + - Length + """ + _T = bytes @classmethod