![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.python archiveRe: self modifying code
From: Ben C <spamspam@spam.eggs>
Date: Sun Apr 30 2006 - 00:43:50 CEST
On 2006-04-29, Robin Becker <robin@NOSPAMreportlab.com> wrote:
It looks quite clever (a bit too clever ... :)
> It could be replaced by
Why not just:
data = None
if not data:
return simple(data, a)
Or nicer to use a "singleton" perhaps than a global, perhaps something
class Func(object):
def __init__(self):
self.data = None
def simple(self, a):
def __call__(self, a):
func = Func()
func(a)
|