P
Peter Cacioppi
Is the following considered poor Python form?
class Foo (object) :
_lazy = None
def foo(self, x) :
_lazy = _lazy or self.get_something(x)
def get_something(self, x) :
# doesn't really matter
I like this idiom for certain situations, just wondering if it will raise the hackles of other Pythonistas.
I use this idiom sparingly, but sometimes it just fits the task at hand, I hear Guidos voice saying "use the Force" in my ear, etc.
class Foo (object) :
_lazy = None
def foo(self, x) :
_lazy = _lazy or self.get_something(x)
def get_something(self, x) :
# doesn't really matter
I like this idiom for certain situations, just wondering if it will raise the hackles of other Pythonistas.
I use this idiom sparingly, but sometimes it just fits the task at hand, I hear Guidos voice saying "use the Force" in my ear, etc.