Skip to content

Commit 4286aed

Browse files
committed
Chore: remove unnecessary _RpcNode._readable and type hint _RpcBase._data_type
1 parent 1f21ea0 commit 4286aed

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

python/twinleaf/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def _survey(self) -> dict[str, _rpc_type]:
157157
if isinstance(attr, _RpcNode):
158158
# Check if it's an RPC that should be read
159159
if isinstance(attr, _RpcBase):
160-
if attr._readable and attr._data_type is not None:
160+
if attr._data_type not in { None, bytes }:
161161
results[attr.__name__] = attr()
162162

163163
# Recursively survey children (works for both Rpc and Survey)
@@ -169,8 +169,8 @@ class _RpcBase(_RpcNode):
169169
def __init__(self, pyrpc: _twinleaf._Rpc, device: Device):
170170
super().__init__(pyrpc.name, device)
171171
self._size_bytes = pyrpc.size_bytes
172-
self._readable = pyrpc.readable
173172
self._writable = pyrpc.writable
173+
self._data_type: type | None = None
174174
match pyrpc.type_str:
175175
case t if t.startswith('i'): self._data_type, self._signed = int, True
176176
case t if t.startswith('u'): self._data_type, self._signed = int, False

0 commit comments

Comments
 (0)