<filename>memoize.py<gh_stars>0
class memoize(object):
	"""
	Memoize wrapper for python
 
 	Usage:

 	@memoize
 	def fib(n):
    	pass
    	
	"""
	def __init__(self, function):
		self.function = function
		self.memoized = {}

	def __call__(self, *args):
		try:
			return self.memoized[args]
		except KeyError:
			self.memoized[args] = self.function(*args)
			return self.memoized[args]

<filename>memoize.py<gh_stars>0
class memoize(object):
	"""
	Memoize wrapper for python
 
 	Usage:

 	@memoize
 	def fib(n):
    	pass
    	
	"""
	def __init__(self, function):
		self.function = function
		self.memoized = {}

	def __call__(self, *args):
		try:
			return self.memoized[args]
		except KeyError:
			self.memoized[args] = self.function(*args)
			return self.memoized[args]

Memoize wrapper for python    	Usage:   	@memoize  	def fib(n):     	pass