On Sat, Oct 19, 2013 at 2:44 PM, Peter Cacioppi <peter.cacio...@gmail.com> wrote: > Is the following considered poor Python form? > > class Foo (object) : > _lazy = None > def foo(self, x) : > self._lazy = self._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.
It raises my hackles, but not for any good reason. I've seen it a number of times in the Twisted codebase, so you're not alone in using it. -- Devin -- https://mail.python.org/mailman/listinfo/python-list