Esempio n. 1
0
    def __init__(self, space, name, superclass, is_singleton=False):
        W_ModuleObject.__init__(self, space, name, superclass)
        self.is_singleton = is_singleton

        if self.superclass is not None:
            self.superclass.inherited(space, self)
            # During bootstrap, we cannot create singleton classes, yet
            if not self.is_singleton and not space.bootstrap:
                self.getsingletonclass(space)
Esempio n. 2
0
 def ancestors(self, include_singleton=True, include_self=True):
     assert include_self
     ary = W_ModuleObject.ancestors(self,
         include_singleton, not (self.is_singleton and not include_singleton)
     )
     if self.superclass is not None:
         ary += self.superclass.ancestors(include_singleton)
     return ary
Esempio n. 3
0
 def find_method_super(self, space, name):
     method = W_ModuleObject.find_method_super(self, space, name)
     if method is None and self.superclass is not None:
         method = self.superclass.find_method(space, name)
     return method
Esempio n. 4
0
 def newmodule(self, name):
     return W_ModuleObject(self, name, self.w_object)