Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(356)

Side by Side Diff: client/third_party/infra_libs/memoize.py

Issue 2013943002: Changing license header, again! (Closed) Base URL: git@github.com:luci/luci-py.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # that can be found in the LICENSE file.
4 4
5 """ 5 """
6 Collection of decorators to help optimize Python functions and classes 6 Collection of decorators to help optimize Python functions and classes
7 by caching return values. 7 by caching return values.
8 8
9 Return values are (by default) keyed off of the function's parameters. 9 Return values are (by default) keyed off of the function's parameters.
10 Consequently, any parameters that are used in memoization must be hashable. 10 Consequently, any parameters that are used in memoization must be hashable.
11 11
12 This library offers two styles of memoization: 12 This library offers two styles of memoization:
13 1) Absolute memoization (memo) uses the full set of parameters against a 13 1) Absolute memoization (memo) uses the full set of parameters against a
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 Args: 180 Args:
181 ignore: (list) The names of parameters to ignore when memoizing. 181 ignore: (list) The names of parameters to ignore when memoizing.
182 """ 182 """
183 def wrap(func): 183 def wrap(func):
184 return MemoizedFunction( 184 return MemoizedFunction(
185 func, 185 func,
186 ignore=ignore, 186 ignore=ignore,
187 memo_dict=memo_dict, 187 memo_dict=memo_dict,
188 ) 188 )
189 return wrap 189 return wrap
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698