Python Classes

Lamonte Harris pyth0nc0d3r at gmail.com
Tue Aug 28 01:04:09 EDT 2007


How come you have to set the initialized created variables to equal the
parameters, shouldn't that be default?

class testing:
         def __init__(self,testing):
                   self.testing = testing
x = testing("testing")
print x.testing


How come self.testing = testing

Can someone explain that in more detail, just confused on why you have to
set it up like that.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070828/7c3b7545/attachment.html>


More information about the Python-list mailing list