Do all classes need an __init__() method? I have classes that look much
like this one starts out:
class GenerateXML(object):
"""Defines methods to be inherited for StaticXML and AnimationXML"""
def __init__(self):
pass
I would rather not do that. Code without it runs fine, but wil
Corey Richardson wrote:
Do all classes need an __init__() method? I have classes that look much
like this one starts out:
class GenerateXML(object):
"""Defines methods to be inherited for StaticXML and AnimationXML"""
def __init__(self):
pass
I would rather not do that. Code wit
"Corey Richardson" wrote
Do all classes need an __init__() method? I have classes that look
much
like this one starts out:
No, init() is only for initialising the object instance.
If you have no local instance spwecific initialisation
you can leave it to the inherited init() aor have no ini
On 1/9/2011 4:42 PM, Alan Gauld wrote:
"Corey Richardson" wrote
Do all classes need an __init__() method? I have classes that look much
like this one starts out:
No, init() is only for initialising the object instance.
If you have no local instance spwecific initialisation
you can leave it
"bob gailer" wrote
No, init() is only for initialising the object instance.
If you have no local instance spwecific initialisation
you can leave it to the inherited init() aor have no init()
at all.
Well I'd like to expand that a bit. There are cases where I create a
class attribute and upd
On 01/09/2011 04:27 PM, Steven D'Aprano wrote:
> Corey Richardson wrote:
>> Do all classes need an __init__() method? I have classes that look much
>> like this one starts out:
>>
>> class GenerateXML(object):
>> """Defines methods to be inherited for StaticXML and AnimationXML"""
>> def __