@@ -216,7 +216,7 @@ class PythonNode(PNode):
216216 Whether the value should be hashed to determine the state. Use ``True`` for
217217 objects that are hashable like strings and tuples. For dictionaries and other
218218 non-hashable objects, you need to provide a function that can hash these
219- objects.
219+ objects. The function should return either an integer or a string.
220220 node_info
221221 The infos acquired while collecting the node.
222222
@@ -235,7 +235,7 @@ class PythonNode(PNode):
235235
236236 name : str = ""
237237 value : Any | NoDefault = no_default
238- hash : bool | Callable [[Any ], bool ] = False
238+ hash : bool | Callable [[Any ], int | str ] = False
239239 node_info : NodeInfo | None = None
240240
241241 @property
@@ -269,7 +269,8 @@ def state(self) -> str | None:
269269 If ``hash = False``, the function returns ``"0"``, a constant hash value, so the
270270 :class:`PythonNode` is ignored when checking for a changed state of the task.
271271
272- If ``hash`` is a callable, then use this function to calculate a hash.
272+ If ``hash`` is a callable, then use this function to calculate a hash expecting
273+ an integer or string.
273274
274275 If ``hash = True``, the builtin ``hash()`` function (`link
275276 <https://docs.python.org/3.11/library/functions.html?highlight=hash#hash>`_) is
0 commit comments