Skip to content

Commit 384e38a

Browse files
committed
ADD: add type hint
1 parent 9b438c2 commit 384e38a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name="cc.udp",
8-
version="2024.8.16",
8+
version="2024.8.31",
99
author="Uncertainty.",
1010
author_email="[email protected]",
1111
description="UDP helper function for robotics workload.",

src/cc/udp/core.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def __init__(self, addr=("0.0.0.0", 8000)):
2222
self._sock.bind(self.addr)
2323
print("UDP Rx is initialized:", self.addr)
2424

25-
def stop(self):
25+
def stop(self) -> None:
2626
"""
2727
Close the socket.
2828
"""
@@ -99,13 +99,13 @@ def __init__(self, addr=("0.0.0.0", 8000)):
9999

100100
print("UDP Tx is initialized:", self.addr)
101101

102-
def stop(self):
102+
def stop(self) -> None:
103103
"""
104104
Close the socket.
105105
"""
106106
self._sock.close()
107107

108-
def send(self, buffer):
108+
def send(self, buffer: bytes) -> None:
109109
"""
110110
Send data
111111
@@ -114,7 +114,7 @@ def send(self, buffer):
114114
"""
115115
self._sock.sendto(buffer, self.addr)
116116

117-
def send_dict(self, data: dict):
117+
def send_dict(self, data: dict) -> None:
118118
"""
119119
Serialize a python dictionary and send it.
120120
@@ -125,7 +125,7 @@ def send_dict(self, data: dict):
125125
buffer = buffer.encode()
126126
self.send(buffer)
127127

128-
def send_numpy(self, data: np.ndarray):
128+
def send_numpy(self, data: np.ndarray) -> None:
129129
"""
130130
Serialize a numpy array and send it.
131131

0 commit comments

Comments
 (0)