On Mon, May 19, 2008 at 5:21 PM, Marilyn Davis <[EMAIL PROTECTED]> wrote:
> Hi Tutors and Tutees,
>
> I've been teaching Python quite a while and a brilliant student asked a
> question that made me realize a big hole in my understanding.
>
> I think it is really magical that, when I define __getite
> I think it is really magical that, when I define __getitem__ on classic
> classes, the built-in iterator uses it.
>
> But, when I make the same class as a new style class, I lose this behavior.
>
> I didn't realize that something was lost in defining a new style class.
> Maybe it's something
Jan Eden wrote:
> My actual code looks like this:
>
> class Base:
> def GetOwnType(self):
> try: return self._own_type
> except: return self.child_type
>
> def SetOwnType(self, value):
> self._own_type = value
>
> own_type = property(GetOwnType, Se
Hi Kent,
Kent Johnson wrote on 29.09.2005:
>>Data.Base has no base classes, so it is not based on a built-in
>>type: How can it be a new-style class?
>
>Data.Base is not a new-style class, but the classes in Show are. And
>properties may appear to work in old-style classes. This document
>http://
Jan Eden wrote:
> Hi,
>
> after updating a program to use new-style classes, I am a bit confused. My
> setup looks like this (simplified):
>
> #Show.py
>
> import Data
>
> class Base(object):
> ...
>
> class Page(Data.Page, Base):
> ...
>
> class Author(Data.Author, Base):
> ...