Ejemplo n.º 1
0
    def __init__(self, config=None):
        self._seen_extras = []
        ObjSpace.__init__(self, config=config)
        self.setup()

        # Be sure to annotate W_SliceObject constructor.
        # In Python2, this is triggered by W_InstanceObject.__getslice__.
        def build_slice():
            self.newslice(self.w_None, self.w_None, self.w_None)

        def attach_list_strategy():
            # this is needed for modules which interacts directly with
            # std.listobject.W_ListObject, e.g. after an isinstance check. For
            # example, _hpy_universal. We need to attach a couple of attributes
            # so that the annotator annotates them with the correct types
            from pypy.objspace.std.listobject import W_ListObject, ObjectListStrategy
            space = self
            w_obj = w_some_obj()
            if isinstance(w_obj, W_ListObject):
                w_obj.space = space
                w_obj.strategy = ObjectListStrategy(space)
                list_w = [w_some_obj(), w_some_obj()]
                w_obj.lstorage = w_obj.strategy.erase(list_w)

        self._seen_extras.append(build_slice)
        self._seen_extras.append(attach_list_strategy)
Ejemplo n.º 2
0
    def __init__(self, config=None):
        self._seen_extras = []
        ObjSpace.__init__(self, config=config)
        self.setup()

        # Be sure to annotate W_SliceObject constructor.
        # In Python2, this is triggered by W_InstanceObject.__getslice__.
        def build_slice():
            self.newslice(self.w_None, self.w_None, self.w_None)
        self._seen_extras.append(build_slice)
Ejemplo n.º 3
0
 def __init__(self, config=None):
     self._seen_extras = []
     ObjSpace.__init__(self, config=config)
     self.setup()
Ejemplo n.º 4
0
 def __init__(self, config=None):
     self._seen_extras = []
     ObjSpace.__init__(self, config=config)