记录回调函数参数返回类型的常规做法?

时间:2018-06-07 16:32:24

标签: python return-type docstring

我是docstring-ing函数,它将回调函数作为参数。客户端代码开发人员应该知道每个传递函数的rtype。

在函数对象的:param docstring中指示这个的公认惯例是什么?

注意:此问题与How do I document :rtype: for a function that returns multiple possible data types?不同。

修改 现在我正在使用它:

:param predicate: Determines when to consolidate two adjacent 
                  MyClass instances.
:type predicate: callbackFunction(thing1, thing2) -> bool

0 个答案:

没有答案
相关问题