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 the unecessary constructors.
>
> >
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 the unecessary constructors.
>
> ie.
>
> class BaseClass:
> @classmethod
> def loadData(params):
On Jun 13, 9:03 pm, Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
> On Wed, 13 Jun 2007 23:55:02 +, James Turk wrote:
> > 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
En Wed, 13 Jun 2007 22:03:50 -0300, Steven D'Aprano
<[EMAIL PROTECTED]> escribió:
> On Wed, 13 Jun 2007 23:55:02 +, James Turk wrote:
>>> James Turk wrote:
>>>
>>> > I have a situation where I have some class members that should only
>>> be
>>> > done once. Essentially my problem looks li
On Wed, 13 Jun 2007 23:55:02 +, James Turk wrote:
> 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
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):
> > dataset = None
>
> > def __init__(self, p
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):
> dataset = None
>
> def __init__(self, param):
> if type(self).dataset is None:
> # code t
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):
> > dataset = None
>
> > def __init__(self
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):
> dataset = None
>
> def __init__(self, param):
> if type(self).dataset is None:
> # code t
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
10 matches
Mail list logo