[Tutor] __init__() - is it required?

Corey Richardson kb1pkl at aim.com
Sun Jan 9 18:28:54 CET 2011


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 will there be
any negative consequences down the road? Does object define an __init__
method for me?


More information about the Tutor mailing list