Skip to content

Commit

Permalink
ADD: add type hint
Browse files Browse the repository at this point in the history
  • Loading branch information
T-K-233 committed Sep 1, 2024
1 parent 9b438c2 commit 384e38a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="cc.udp",
version="2024.8.16",
version="2024.8.31",
author="Uncertainty.",
author_email="t_k_233@outlook.email",
description="UDP helper function for robotics workload.",
Expand Down
10 changes: 5 additions & 5 deletions src/cc/udp/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(self, addr=("0.0.0.0", 8000)):
self._sock.bind(self.addr)
print("UDP Rx is initialized:", self.addr)

def stop(self):
def stop(self) -> None:
"""
Close the socket.
"""
Expand Down Expand Up @@ -99,13 +99,13 @@ def __init__(self, addr=("0.0.0.0", 8000)):

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

def stop(self):
def stop(self) -> None:
"""
Close the socket.
"""
self._sock.close()

def send(self, buffer):
def send(self, buffer: bytes) -> None:
"""
Send data
Expand All @@ -114,7 +114,7 @@ def send(self, buffer):
"""
self._sock.sendto(buffer, self.addr)

def send_dict(self, data: dict):
def send_dict(self, data: dict) -> None:
"""
Serialize a python dictionary and send it.
Expand All @@ -125,7 +125,7 @@ def send_dict(self, data: dict):
buffer = buffer.encode()
self.send(buffer)

def send_numpy(self, data: np.ndarray):
def send_numpy(self, data: np.ndarray) -> None:
"""
Serialize a numpy array and send it.
Expand Down

0 comments on commit 384e38a

Please sign in to comment.