Constructors...BIIIIG PROBLEM!

Amogh M S msamogh at gmail.com
Thu Sep 1 03:48:52 EDT 2011


Hey guys...
I think we have a problem with my _init_ method and the constructor
When I create a class and its _init_ method and try to create an object of
it outside the class,
Say, something like

class S:
   def _init_(self, name=None):
       self.name = name
s = S("MyName")

It says that the constructor takes no arguments!! I have to explicitly call
the _init_ method which, I think is not the right way of doing things...
Could you tell me if that is what is supposed to happen or is something
wrong with my code?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110901/e19420c3/attachment.html>


More information about the Python-list mailing list