From 64db2e00ccf6cebf8a752e757dfce4729cc7a349 Mon Sep 17 00:00:00 2001 From: Prodesire Date: Thu, 14 Dec 2017 20:10:06 +0800 Subject: [PATCH] fix func name error in misc doc --- docs/misc.rst | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/misc.rst b/docs/misc.rst index 75d46ee..71b8530 100644 --- a/docs/misc.rst +++ b/docs/misc.rst @@ -1,25 +1,23 @@ Miscellanea ----------- -.. py:function:: pydu.misc.unix_timeout(seconds) +.. py:function:: pydu.misc.timeout(seconds) This func decorates any func which may be hang for a while. The param ``seconds`` - should be integer. + can be either integer or float. In `test.py`, you may write like below: .. code-block:: python import time from pydu.misc import unix_timeout - @unix_timeout(1) + @timeout(1) def f(): time.sleep(1.01) f() And run `test.py`, will see ``TimeoutError``. - .. note:: ``unix_timeout`` can only be used on ``unix-like`` system. - .. py:function:: pydu.misc.trace(obj)