[Numpy-discussion] question about standalone small software and teaching

Bill Baxter wbaxter at gmail.com
Wed Apr 4 22:12:52 EDT 2007


Ok, I got another hopefully easy question:

Why this:
    class Point(object):
          ...

Instead of the style that's used in the Python tutorial in the
'classes' chapter:
    class Point:
        ...

--bb


On 4/5/07, Robert Kern <robert.kern at gmail.com> wrote:
> Sebastian Haase wrote:
>
> > OK, but what is "wrong" with the first way !?  I mean,  it somehow
> > seems not like "it's usually done" in Python ?  Normally there is
> > always a __init__(self) that sets up everything referring to self --
> > why is this tutorial doing it differently ?
>
> Because it makes the code more readable for the point it's trying to get across.
> The __init__ style code would be irrelevant detail detracting from the main point.
>
> --
> Robert Kern
>
> "I have come to believe that the whole world is an enigma, a harmless enigma
>  that is made terrible by our own mad attempt to interpret it as though it had
>  an underlying truth."
>   -- Umberto Eco
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
>



More information about the NumPy-Discussion mailing list