[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [chutney/master] add documentation for Node.specialize and Node.__init__
commit 38e8883410966a748624cd37ab520ff99d3c495f
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date: Thu Apr 23 12:53:22 2020 -0400
add documentation for Node.specialize and Node.__init__
---
lib/chutney/TorNet.py | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/lib/chutney/TorNet.py b/lib/chutney/TorNet.py
index 6b5b88e..4119a18 100644
--- a/lib/chutney/TorNet.py
+++ b/lib/chutney/TorNet.py
@@ -427,6 +427,12 @@ class Node(object):
# Users are expected to call these:
def __init__(self, parent=None, **kwargs):
+ """Create a new Node.
+
+ Initial fields in this Node's environment are set from 'kwargs'.
+
+ Any fields not found there will be searched for in 'parent'.
+ """
self._parent = parent
self._env = self._createEnviron(parent, kwargs)
self._builder = None
@@ -436,6 +442,9 @@ class Node(object):
return [Node(self) for _ in range(N)]
def specialize(self, **kwargs):
+ """Return a new Node based on this node's value as its defaults,
+ but with the values from 'kwargs' (if any) overriding them.
+ """
return Node(parent=self, **kwargs)
def set_runtime(self, key, fn):
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits