On Feb 7, 12:20 pm, "Sébastien Vincent" free.fr>
wrote:
> I've found some class on the Net which takes basically this form :
>
> ##
> class Foo:
> def __init__(self):
> self.tasks = []
>...
>
> def method1(self):
> tasks = []
> while True:
> ...
> append
On Jun 13, 11:42 pm, Steven Bethard <[EMAIL PROTECTED]> wrote:
> James Turk wrote:
> > It actually occured to me that I could use a @classmethod to do the
> > loading and take that out of the BaseClass constructor. What I have
> > makes more sense and eliminates
On Jun 13, 9:03 pm, Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
> On Wed, 13 Jun 2007 23:55:02 +0000, James Turk wrote:
> > On Jun 13, 6:54 pm, Steven Bethard <[EMAIL PROTECTED]> wrote:
> >> James Turk wrote:
> >> > Hi,
>
> >> > I have a
On Jun 13, 8:00 pm, Larry Bates <[EMAIL PROTECTED]> wrote:
> James Turk wrote:
> > Hi,
>
> > I have a situation where I have some class members that should only be
> > done once. Essentially my problem looks like this:
>
> > class Base(object):
> >
On Jun 13, 6:54 pm, Steven Bethard <[EMAIL PROTECTED]> wrote:
> James Turk wrote:
> > Hi,
>
> > I have a situation where I have some class members that should only be
> > done once. Essentially my problem looks like this:
>
> > class Base(object):
> &
Hi,
I have a situation where I have some class members that should only be
done once. Essentially my problem looks like this:
class Base(object):
dataset = None
def __init__(self, param):
if type(self).dataset is None:
# code to load dataset based on param, expensive