Skip to content

Commit 27847ab

Browse files
committed
bit more info in docstring
1 parent 3b77a69 commit 27847ab

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

boltons/funcutils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,6 @@ def decorate(func, pre_func=noop, post_func=noop):
10071007

10081008

10091009

1010-
_UNSET = object()
10111010

10121011

10131012
def once(func):
@@ -1016,6 +1015,9 @@ def once(func):
10161015
block until the first execution completes, then all receive the
10171016
cached result.
10181017
1018+
This is especially useful in cases like logging, where multiple
1019+
initializations can cause problems.
1020+
10191021
The decorated function must take no arguments.
10201022
10211023
>>> call_count = 0
@@ -1031,6 +1033,7 @@ def once(func):
10311033
>>> call_count
10321034
1
10331035
"""
1036+
_UNSET = object()
10341037
lock = threading.Lock()
10351038
result = _UNSET
10361039

0 commit comments

Comments
 (0)