diff --git a/kademlia/node.py b/kademlia/node.py index 2f087f5..c8bc406 100644 --- a/kademlia/node.py +++ b/kademlia/node.py @@ -3,7 +3,21 @@ import heapq class Node: + """ + Simple object to encapsulate the concept of a Node (minimally an ID, but + also possibly an IP and port if this represents a node on the network). + This class should generally not be instantiated directly, as it is a low + level construct mostly used by the router. + """ def __init__(self, node_id, ip=None, port=None): + """ + Create a Node instance. + + Args: + node_id (int): A value between 0 and 2^160 + ip (string): Optional IP address where this Node lives + port (int): Optional port for this Node (set when IP is set) + """ self.id = node_id # pylint: disable=invalid-name self.ip = ip # pylint: disable=invalid-name self.port = port