![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.python archiveRe: Memoization and encapsulation
From: Just <just@xs4all.nl>
Date: Sat Dec 31 2005 - 09:23:05 CET
In article <pan.2005.12.31.04.23.25.584823@REMOVETHIScyber.com.au>,
> I was playing around with simple memoization and came up with something
There's no need to declare _cache as global, since you're not assigning
> if _cache.has_key(x):
I actually prefer such a global variable to the default arg trick. The
_cache = {}
Just
|