File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,8 @@ def calculate_performance(employee):
110
110
custom_key_maker_info .defaults != user_function_info .defaults or \
111
111
custom_key_maker_info .kwonlydefaults != user_function_info .kwonlydefaults :
112
112
warnings .warn ('Expected custom_key_maker to have the same signature as the function being cached. '
113
- 'Call memoization.suppress_warnings() to remove this message.' , SyntaxWarning )
113
+ 'Call memoization.suppress_warnings() before using @cached to remove this message.' ,
114
+ SyntaxWarning )
114
115
115
116
def custom_key_maker_wrapper (args , kwargs ):
116
117
return custom_key_maker (* args , ** kwargs )
@@ -127,6 +128,7 @@ def custom_key_maker_wrapper(args, kwargs):
127
128
def suppress_warnings (should_warn = False ):
128
129
"""
129
130
Disable/Enable warnings when @cached is used
131
+ Must be called before using @cached
130
132
131
133
:param should_warn: Whether warnings should be shown (False by default)
132
134
"""
You can’t perform that action at this time.
0 commit comments