Python Classes

Lamonte Harris pyth0nc0d3r at gmail.com
Tue Aug 28 17:13:32 CEST 2007


Ok thanks I'll try remembering it.

On 8/28/07, Erik Jones <erik at myemma.com> wrote:
>
> On Aug 28, 2007, at 12:04 AM, Lamonte Harris wrote:
>
> > 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.
> > --
>
> Simple Answer:
>
> Because language should never set variable values "by default".
> That's what programmers are for.  There may be application domains
> where *some* defaulting behavior makes sense, but that's what
> frameworks and DSLs are for.
>
> Erik Jones
>
> Software Developer | Emma(r)
> erik at myemma.com
> 800.595.4401 or 615.292.5888
> 615.292.0777 (fax)
>
> Emma helps organizations everywhere communicate & market in style.
> Visit us online at http://www.myemma.com
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070828/ea16f538/attachment.html>


More information about the Python-list mailing list