Skip to content

Commit 8515106

Browse files
committed
Add data converter docs
1 parent 0125c8f commit 8515106

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

tivars/data.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,21 @@ def set(cls, value: _T, **kwargs) -> bytes:
7474

7575

7676
class Data(Bytes):
77+
"""
78+
No-op converter for data sections with associated metadata
79+
80+
The following metadata fields are automatically set by this converter:
81+
82+
- Version
83+
"""
84+
7785
_T = bytes
7886

7987
@classmethod
8088
def set(cls, value: _T, *, instance=None, **kwargs) -> _T:
8189
"""
8290
Converts ``bytes`` -> ``bytes`` and updates metadata fields
8391
84-
Certain metadata fields are updated automatically based on the entry's data.
85-
The following are set by this converter:
86-
87-
- Version
88-
- Length (for sized data)
89-
9092
:param value: The value to convert
9193
:param instance: The instance which contains the data section
9294
:return: The bytes in ``value``, unchanged
@@ -97,6 +99,15 @@ def set(cls, value: _T, *, instance=None, **kwargs) -> _T:
9799

98100

99101
class SizedData(Data):
102+
"""
103+
No-op converter for sized data sections with associated metadata
104+
105+
The following metadata fields are automatically set by this converter:
106+
107+
- Version
108+
- Length
109+
"""
110+
100111
_T = bytes
101112

102113
@classmethod

0 commit comments

Comments
 (0)