Changeset 56

Show
Ignore:
Timestamp:
12/12/06 18:40:28 (2 years ago)
Author:
KirkMcDonald
Message:

Basic inheritance support.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/infrastructure/pyd/class_wrap.d

    r54 r56  
    385385    type.tp_name      = (module_name ~ "." ~ name ~ \0).ptr; 
    386386 
     387    // Check for wrapped parent classes 
     388    static if (is(T B == super)) { 
     389        foreach (C; B) { 
     390            static if (is(C == class) && !is(C == Object)) { 
     391                if (is_wrapped!(C)) { 
     392                    type.tp_base = &wrapped_class_type!(C); 
     393                } 
     394            } 
     395        } 
     396    } 
     397 
    387398    // Numerical operator overloads 
    388399    if (wrapped_class_as_number!(T) != PyNumberMethods.init) {