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

Robert Kern robert.kern@gmail....
Wed Apr 4 21:16:30 CDT 2007


Bill Baxter wrote:
> 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:
>         ...

Because the former make new-style classes and the latter make old-style classes.
It's not an issue of personal preference: they are somewhat different object
models and there are things that old-style classes can't do. As HasTraits is
also a new-style class, there's no point in using old-style classes in this
tutorial.

-- 
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


More information about the Numpy-discussion mailing list