Ejemplo n.º 1
0
 def newdict(self, module=False, instance=False, classofinstance=None,
             from_strdict_shared=None, strdict=False):
     from pypy.objspace.std.dictmultiobject import W_DictMultiObject
     return W_DictMultiObject.allocate_and_init_instance(
             self, module=module, instance=instance,
             classofinstance=classofinstance,
             from_strdict_shared=from_strdict_shared,
             strdict=strdict)
Ejemplo n.º 2
0
 def newdict(self,
             module=False,
             instance=False,
             kwargs=False,
             strdict=False):
     return W_DictMultiObject.allocate_and_init_instance(self,
                                                         module=module,
                                                         instance=instance,
                                                         strdict=strdict,
                                                         kwargs=kwargs)
Ejemplo n.º 3
0
 def newdict(self,
             module=False,
             instance=False,
             classofinstance=None,
             from_strdict_shared=None):
     return W_DictMultiObject.allocate_and_init_instance(
         self,
         module=module,
         instance=instance,
         classofinstance=classofinstance,
         from_strdict_shared=from_strdict_shared)
Ejemplo n.º 4
0
def descr_fromkeys(space, w_type, w_keys, w_fill=None):
    from pypy.objspace.std.dictmultiobject import W_DictMultiObject
    if w_fill is None:
        w_fill = space.w_None
    if space.is_w(w_type, space.w_dict):
        w_dict = W_DictMultiObject.allocate_and_init_instance(space, w_type)
        for w_key in space.listview(w_keys):
            w_dict.setitem(w_key, w_fill)
    else:
        w_dict = space.call_function(w_type)
        for w_key in space.listview(w_keys):
            space.setitem(w_dict, w_key, w_fill)
    return w_dict
Ejemplo n.º 5
0
def descr_fromkeys(space, w_type, w_keys, w_fill=None):
    from pypy.objspace.std.dictmultiobject import W_DictMultiObject
    if w_fill is None:
        w_fill = space.w_None
    if space.is_w(w_type, space.w_dict):
        w_dict = W_DictMultiObject.allocate_and_init_instance(space, w_type)
        for w_key in space.listview(w_keys):
            w_dict.setitem(w_key, w_fill)
    else:
        w_dict = space.call_function(w_type)
        for w_key in space.listview(w_keys):
            space.setitem(w_dict, w_key, w_fill)
    return w_dict
Ejemplo n.º 6
0
 def newdict(self,
             module=False,
             instance=False,
             classofinstance=None,
             from_strdict_shared=None,
             strdict=False):
     from pypy.objspace.std.dictmultiobject import W_DictMultiObject
     return W_DictMultiObject.allocate_and_init_instance(
         self,
         module=module,
         instance=instance,
         classofinstance=classofinstance,
         from_strdict_shared=from_strdict_shared,
         strdict=strdict)
Ejemplo n.º 7
0
 def newdict(self, module=False, instance=False, classofinstance=None):
     return W_DictMultiObject.allocate_and_init_instance(
             self, module=module, instance=instance,
             classofinstance=classofinstance)
Ejemplo n.º 8
0
 def newdict(self, module=False, instance=False, kwargs=False,
             strdict=False):
     return W_DictMultiObject.allocate_and_init_instance(
             self, module=module, instance=instance,
             strdict=strdict, kwargs=kwargs)
Ejemplo n.º 9
0
def descr__new__(space, w_dicttype, __args__):
    from pypy.objspace.std.dictmultiobject import W_DictMultiObject
    w_obj = W_DictMultiObject.allocate_and_init_instance(space, w_dicttype)
    return w_obj
Ejemplo n.º 10
0
 def newdict(self, module=False, instance=False):
     return W_DictMultiObject.allocate_and_init_instance(self,
                                                         module=module,
                                                         instance=instance)
Ejemplo n.º 11
0
def descr__new__(space, w_dicttype, __args__):
    from pypy.objspace.std.dictmultiobject import W_DictMultiObject
    w_obj = W_DictMultiObject.allocate_and_init_instance(space, w_dicttype)
    return w_obj
Ejemplo n.º 12
0
 def newdict(self, module=False, instance=False, classofinstance=None,
             strdict=False):
     return W_DictMultiObject.allocate_and_init_instance(
             self, module=module, instance=instance,
             classofinstance=classofinstance,
             strdict=strdict)