[pypy-svn] r31303 - in pypy/dist/pypy: . annotation interpreter interpreter/pyparser interpreter/test module/__builtin__ module/__builtin__/test module/_pickle_support module/posix module/sys module/thread objspace/cclp objspace/cclp/constraint objspace/constraint objspace/cpy objspace/cpy/test objspace/flow objspace/flow/test objspace/std objspace/std/test rpython tool/pytest tool/test translator translator/goal translator/pyrex

mwh at codespeak.net mwh at codespeak.net
Mon Aug 14 19:40:38 CEST 2006


Author: mwh
Date: Mon Aug 14 19:40:34 2006
New Revision: 31303

Modified:
   pypy/dist/pypy/annotation/annrpython.py
   pypy/dist/pypy/annotation/bookkeeper.py
   pypy/dist/pypy/conftest.py
   pypy/dist/pypy/interpreter/argument.py
   pypy/dist/pypy/interpreter/baseobjspace.py
   pypy/dist/pypy/interpreter/eval.py
   pypy/dist/pypy/interpreter/executioncontext.py
   pypy/dist/pypy/interpreter/function.py
   pypy/dist/pypy/interpreter/gateway.py
   pypy/dist/pypy/interpreter/module.py
   pypy/dist/pypy/interpreter/pycode.py
   pypy/dist/pypy/interpreter/pycompiler.py
   pypy/dist/pypy/interpreter/pyopcode.py
   pypy/dist/pypy/interpreter/pyparser/pythonparse.py
   pypy/dist/pypy/interpreter/test/test_argument.py
   pypy/dist/pypy/interpreter/test/test_compiler.py
   pypy/dist/pypy/interpreter/test/test_eval.py
   pypy/dist/pypy/interpreter/test/test_function.py
   pypy/dist/pypy/interpreter/test/test_gateway.py
   pypy/dist/pypy/interpreter/test/test_objspace.py
   pypy/dist/pypy/interpreter/typedef.py
   pypy/dist/pypy/module/__builtin__/compiling.py
   pypy/dist/pypy/module/__builtin__/test/test_builtin.py
   pypy/dist/pypy/module/__builtin__/test/test_import.py
   pypy/dist/pypy/module/_pickle_support/maker.py
   pypy/dist/pypy/module/posix/interp_posix.py
   pypy/dist/pypy/module/sys/state.py
   pypy/dist/pypy/module/thread/os_local.py
   pypy/dist/pypy/objspace/cclp/constraint/constraint.py
   pypy/dist/pypy/objspace/cclp/constraint/domain.py
   pypy/dist/pypy/objspace/cclp/scheduler.py
   pypy/dist/pypy/objspace/constraint/constraint.py
   pypy/dist/pypy/objspace/cpy/objspace.py
   pypy/dist/pypy/objspace/cpy/test/test_objspace.py
   pypy/dist/pypy/objspace/cpy/test/test_typedef.py
   pypy/dist/pypy/objspace/flow/objspace.py
   pypy/dist/pypy/objspace/flow/test/test_framestate.py
   pypy/dist/pypy/objspace/std/marshal_impl.py
   pypy/dist/pypy/objspace/std/objspace.py
   pypy/dist/pypy/objspace/std/stdtypedef.py
   pypy/dist/pypy/objspace/std/test/test_dictobject.py
   pypy/dist/pypy/objspace/std/typeobject.py
   pypy/dist/pypy/rpython/callparse.py
   pypy/dist/pypy/tool/pytest/appsupport.py
   pypy/dist/pypy/tool/test/test_pytestsupport.py
   pypy/dist/pypy/translator/geninterplevel.py
   pypy/dist/pypy/translator/goal/targetlogicstandalone.py
   pypy/dist/pypy/translator/goal/targetmultiplespaces.py
   pypy/dist/pypy/translator/goal/targetpypymain.py
   pypy/dist/pypy/translator/goal/targetpypystandalone.py
   pypy/dist/pypy/translator/goal/targetthunkstandalone.py
   pypy/dist/pypy/translator/pyrex/genpyrex.py
Log:
remove the extremely-rarely-not-[] argument from the newdict operation.


Modified: pypy/dist/pypy/annotation/annrpython.py
==============================================================================
--- pypy/dist/pypy/annotation/annrpython.py	(original)
+++ pypy/dist/pypy/annotation/annrpython.py	Mon Aug 14 19:40:34 2006
@@ -705,12 +705,8 @@
     def consider_op_newlist(self, *args):
         return self.bookkeeper.newlist(*args)
 
-    def consider_op_newdict(self, *args):
-        assert len(args) % 2 == 0
-        items_s = []
-        for i in range(0, len(args), 2):
-            items_s.append((args[i], args[i+1]))
-        return self.bookkeeper.newdict(*items_s)
+    def consider_op_newdict(self):
+        return self.bookkeeper.newdict()
 
     def consider_op_newslice(self, start, stop, step):
         self.bookkeeper.count('newslice', start, stop, step)

Modified: pypy/dist/pypy/annotation/bookkeeper.py
==============================================================================
--- pypy/dist/pypy/annotation/bookkeeper.py	(original)
+++ pypy/dist/pypy/annotation/bookkeeper.py	Mon Aug 14 19:40:34 2006
@@ -284,14 +284,10 @@
             self.dictdefs[self.position_key] = dictdef
         return dictdef
 
-    def newdict(self, *items_s):
-        """Make a SomeDict associated with the current position, general
-        enough to contain the given (s_key, s_value) as items."""
-        dictdef = self.getdictdef()
-        for s_key, s_value in items_s:
-            dictdef.generalize_key(s_key)
-            dictdef.generalize_value(s_value)
-        return SomeDict(dictdef)
+    def newdict(self):
+        """Make a so-far empty SomeDict associated with the current
+        position."""
+        return SomeDict(self.getdictdef())
 
     def immutableconstant(self, const):
         return self.immutablevalue(const.value)
@@ -801,7 +797,7 @@
         else:
             return SomeTuple(items_s)
 
-    def newdict(self, stuff):
+    def newdict(self):
         raise CallPatternTooComplex, "'**' argument"
 
     def unpackiterable(self, s_obj, expected_length=None):

Modified: pypy/dist/pypy/conftest.py
==============================================================================
--- pypy/dist/pypy/conftest.py	(original)
+++ pypy/dist/pypy/conftest.py	Mon Aug 14 19:40:34 2006
@@ -316,5 +316,5 @@
         w_class = space.call_function(space.w_type,
                                       space.wrap(clsname),
                                       space.newtuple([]),
-                                      space.newdict([]))
+                                      space.newdict())
         self.w_class = w_class 

Modified: pypy/dist/pypy/interpreter/argument.py
==============================================================================
--- pypy/dist/pypy/interpreter/argument.py	(original)
+++ pypy/dist/pypy/interpreter/argument.py	Mon Aug 14 19:40:34 2006
@@ -284,7 +284,7 @@
                 co_argcount += 1
 
         if has_kwarg:
-            scope_w[co_argcount] = self.space.newdict([])
+            scope_w[co_argcount] = self.space.newdict()
             co_argcount += 1
         return co_argcount
     
@@ -519,7 +519,7 @@
 
         # collect extra keyword arguments into the **kwarg
         if has_kwarg:
-            w_kwds = self.space.newdict([])
+            w_kwds = self.space.newdict()
             if remainingkwds_w:
                 for key, w_value in remainingkwds_w.items():
                     self.space.setitem(w_kwds, self.space.wrap(key), w_value)

Modified: pypy/dist/pypy/interpreter/baseobjspace.py
==============================================================================
--- pypy/dist/pypy/interpreter/baseobjspace.py	(original)
+++ pypy/dist/pypy/interpreter/baseobjspace.py	Mon Aug 14 19:40:34 2006
@@ -692,7 +692,7 @@
         source = source.lstrip()
         assert source.startswith('('), "incorrect header in:\n%s" % (source,)
         source = py.code.Source("def anonymous%s\n" % source)
-        w_glob = space.newdict([])
+        w_glob = space.newdict()
         space.exec_(source.compile(), w_glob, w_glob)
         return space.getitem(w_glob, space.wrap('anonymous'))
 
@@ -833,8 +833,8 @@
 #                  newtuple([w_1, w_2,...]) -> w_tuple
 #                   newlist([w_1, w_2,...]) -> w_list
 #                 newstring([w_1, w_2,...]) -> w_string from ascii numbers (bytes)
-#                newunicode([i1, i2,...]) -> w_unicode from integers
-#            newdict([(w_key,w_value),...]) -> w_dict
+#                  newunicode([i1, i2,...]) -> w_unicode from integers
+#                                 newdict() -> empty w_dict
 #           newslice(w_start,w_stop,w_step) -> w_slice
 #              call_args(w_obj,Arguments()) -> w_result
 

Modified: pypy/dist/pypy/interpreter/eval.py
==============================================================================
--- pypy/dist/pypy/interpreter/eval.py	(original)
+++ pypy/dist/pypy/interpreter/eval.py	Mon Aug 14 19:40:34 2006
@@ -119,7 +119,7 @@
     def fast2locals(self):
         # Copy values from self.fastlocals_w to self.w_locals
         if self.w_locals is None:
-            self.w_locals = self.space.newdict([])
+            self.w_locals = self.space.newdict()
         varnames = self.getcode().getvarnames()
         fastscope_w = self.getfastscope()
         for i in range(min(len(varnames), len(fastscope_w))):

Modified: pypy/dist/pypy/interpreter/executioncontext.py
==============================================================================
--- pypy/dist/pypy/interpreter/executioncontext.py	(original)
+++ pypy/dist/pypy/interpreter/executioncontext.py	Mon Aug 14 19:40:34 2006
@@ -88,7 +88,8 @@
         "Create a new empty 'globals' dictionary."
         w_key = self.space.wrap("__builtins__")
         w_value = self.space.wrap(self.get_builtin())
-        w_globals = self.space.newdict([(w_key, w_value)])
+        w_globals = self.space.newdict()
+        space.setitem(w_globals, w_key, w_value)
         return w_globals
 
     def call_trace(self, frame):

Modified: pypy/dist/pypy/interpreter/function.py
==============================================================================
--- pypy/dist/pypy/interpreter/function.py	(original)
+++ pypy/dist/pypy/interpreter/function.py	Mon Aug 14 19:40:34 2006
@@ -121,7 +121,7 @@
 
     def getdict(self):
         if self.w_func_dict is None:
-            self.w_func_dict = self.space.newdict([])
+            self.w_func_dict = self.space.newdict()
         return self.w_func_dict
 
     def setdict(self, space, w_dict):

Modified: pypy/dist/pypy/interpreter/gateway.py
==============================================================================
--- pypy/dist/pypy/interpreter/gateway.py	(original)
+++ pypy/dist/pypy/interpreter/gateway.py	Mon Aug 14 19:40:34 2006
@@ -828,7 +828,7 @@
 def build_applevel_dict(self, space):
     "NOT_RPYTHON"
     from pypy.interpreter.pycode import PyCode
-    w_glob = space.newdict([])
+    w_glob = space.newdict()
     space.setitem(w_glob, space.wrap('__name__'), space.wrap('__builtin__'))
     space.exec_(self.code, w_glob, w_glob,
                 hidden_applevel=self.hidden_applevel)

Modified: pypy/dist/pypy/interpreter/module.py
==============================================================================
--- pypy/dist/pypy/interpreter/module.py	(original)
+++ pypy/dist/pypy/interpreter/module.py	Mon Aug 14 19:40:34 2006
@@ -10,7 +10,7 @@
     def __init__(self, space, w_name, w_dict=None):
         self.space = space
         if w_dict is None: 
-            w_dict = space.newdict([])
+            w_dict = space.newdict()
         self.w_dict = w_dict 
         self.w_name = w_name 
         if w_name is not None:

Modified: pypy/dist/pypy/interpreter/pycode.py
==============================================================================
--- pypy/dist/pypy/interpreter/pycode.py	(original)
+++ pypy/dist/pypy/interpreter/pycode.py	Mon Aug 14 19:40:34 2006
@@ -292,7 +292,7 @@
         if flags & CO_OPTIMIZED: 
             return 
         if flags & CO_NEWLOCALS:
-            frame.w_locals = frame.space.newdict([])
+            frame.w_locals = frame.space.newdict()
         else:
             assert frame.w_globals is not None
             frame.w_locals = frame.w_globals 

Modified: pypy/dist/pypy/interpreter/pycompiler.py
==============================================================================
--- pypy/dist/pypy/interpreter/pycompiler.py	(original)
+++ pypy/dist/pypy/interpreter/pycompiler.py	Mon Aug 14 19:40:34 2006
@@ -156,7 +156,7 @@
                 w_dict = w_mod.getdict() 
                 w_reg = space.call_method(w_dict, 'setdefault', 
                                           space.wrap("__warningregistry__"),     
-                                          space.newdict([]))
+                                          space.newdict())
                 try: 
                     space.call_method(w_mod, 'warn_explicit', 
                                       space.wrap(message), 

Modified: pypy/dist/pypy/interpreter/pyopcode.py
==============================================================================
--- pypy/dist/pypy/interpreter/pyopcode.py	(original)
+++ pypy/dist/pypy/interpreter/pyopcode.py	Mon Aug 14 19:40:34 2006
@@ -507,7 +507,7 @@
     def BUILD_MAP(f, zero):
         if zero != 0:
             raise pyframe.BytecodeCorruption
-        w_dict = f.space.newdict([])
+        w_dict = f.space.newdict()
         f.valuestack.push(w_dict)
 
     def LOAD_ATTR(f, nameindex):

Modified: pypy/dist/pypy/interpreter/pyparser/pythonparse.py
==============================================================================
--- pypy/dist/pypy/interpreter/pyparser/pythonparse.py	(original)
+++ pypy/dist/pypy/interpreter/pyparser/pythonparse.py	Mon Aug 14 19:40:34 2006
@@ -172,7 +172,7 @@
 
 
 def grammar_rules( space ):
-    w_rules = space.newdict([])
+    w_rules = space.newdict()
     for key, value in PYTHON_PARSER.rules.iteritems():
         space.setitem(w_rules, space.wrap(key), space.wrap(value))
     return w_rules

Modified: pypy/dist/pypy/interpreter/test/test_argument.py
==============================================================================
--- pypy/dist/pypy/interpreter/test/test_argument.py	(original)
+++ pypy/dist/pypy/interpreter/test/test_argument.py	Mon Aug 14 19:40:34 2006
@@ -11,8 +11,8 @@
     def unpackiterable(self, it):
         return list(it)
 
-    def newdict(self, items):
-        return dict(items)
+    def newdict(self):
+        return {}
 
     def setitem(self, obj, key, value):
         obj[key] = value

Modified: pypy/dist/pypy/interpreter/test/test_compiler.py
==============================================================================
--- pypy/dist/pypy/interpreter/test/test_compiler.py	(original)
+++ pypy/dist/pypy/interpreter/test/test_compiler.py	Mon Aug 14 19:40:34 2006
@@ -13,14 +13,14 @@
     def eval_string(self, string, kind='eval'):
         space = self.space
         code = self.compiler.compile(string, '<>', kind, 0)
-        return code.exec_code(space, space.newdict([]), space.newdict([]))
+        return code.exec_code(space, space.newdict(), space.newdict())
 
     def test_compile(self):
         code = self.compiler.compile('6*7', '<hello>', 'eval', 0)
         assert isinstance(code, PyCode)
         assert code.co_filename == '<hello>'
         space = self.space
-        w_res = code.exec_code(space, space.newdict([]), space.newdict([]))
+        w_res = code.exec_code(space, space.newdict(), space.newdict())
         assert space.int_w(w_res) == 42
 
     def test_eval_unicode(self):
@@ -71,7 +71,7 @@
         assert isinstance(code, PyCode)
         assert code.co_filename == '<hello>'
         space = self.space
-        w_globals = space.newdict([])
+        w_globals = space.newdict()
         code.exec_code(space, w_globals, w_globals)
         w_a = space.getitem(w_globals, space.wrap('a'))
         assert space.int_w(w_a) == 1
@@ -141,8 +141,8 @@
     def test_toplevel_docstring(self):
         space = self.space
         code = self.compiler.compile('"spam"; "bar"; x=5', '<hello>', 'exec', 0)
-        w_locals = space.newdict([])
-        code.exec_code(space, space.newdict([]), w_locals)
+        w_locals = space.newdict()
+        code.exec_code(space, space.newdict(), w_locals)
         w_x = space.getitem(w_locals, space.wrap('x'))
         assert space.eq_w(w_x, space.wrap(5))
         w_doc = space.getitem(w_locals, space.wrap('__doc__'))
@@ -150,8 +150,8 @@
         #
         code = self.compiler.compile('"spam"; "bar"; x=5',
                                      '<hello>', 'single', 0)
-        w_locals = space.newdict([])
-        code.exec_code(space, space.newdict([]), w_locals)
+        w_locals = space.newdict()
+        code.exec_code(space, space.newdict(), w_locals)
         w_x = space.getitem(w_locals, space.wrap('x'))
         assert space.eq_w(w_x, space.wrap(5))
         w_doc = space.call_method(w_locals, 'get', space.wrap('__doc__'))
@@ -331,7 +331,7 @@
         '''))
         code = self.compiler.compile(snippet, '<tmp>', 'exec', 0)
         space = self.space
-        w_d = space.newdict([])
+        w_d = space.newdict()
         code.exec_code(space, w_d, w_d)
         w_fline = space.getitem(w_d, space.wrap('fline'))
         w_gline = space.getitem(w_d, space.wrap('gline'))
@@ -365,7 +365,7 @@
         '''))
         code = self.compiler.compile(snippet, '<tmp>', 'exec', 0)
         space = self.space
-        w_d = space.newdict([])
+        w_d = space.newdict()
         space.exec_(code, w_d, w_d)
 
     def test_ellipsis(self):
@@ -376,7 +376,7 @@
         '''))
         code = self.compiler.compile(snippet, '<tmp>', 'exec', 0)
         space = self.space
-        w_d = space.newdict([])
+        w_d = space.newdict()
         space.exec_(code, w_d, w_d)
 
     def test_augassign_with_tuple_subscript(self):
@@ -398,7 +398,7 @@
         '''))
         code = self.compiler.compile(snippet, '<tmp>', 'exec', 0)
         space = self.space
-        w_d = space.newdict([])
+        w_d = space.newdict()
         space.exec_(code, w_d, w_d)
         assert space.int_w(space.getitem(w_d, space.wrap('result'))) == 42
 

Modified: pypy/dist/pypy/interpreter/test/test_eval.py
==============================================================================
--- pypy/dist/pypy/interpreter/test/test_eval.py	(original)
+++ pypy/dist/pypy/interpreter/test/test_eval.py	Mon Aug 14 19:40:34 2006
@@ -33,18 +33,15 @@
         space = self.space 
         w = space.wrap
         self.f.fast2locals()
-        assert space.eq_w(self.f.w_locals, self.space.newdict([]))
+        assert space.eq_w(self.f.w_locals, self.space.wrap({}))
         
         self.f.fastlocals_w[0] = w(5)
         self.f.fast2locals()
-        assert space.eq_w(self.f.w_locals, self.space.newdict([
-                                               (w('x'), w(5))]))
+        assert space.eq_w(self.f.w_locals, self.space.wrap({'x': 5}))
 
         self.f.fastlocals_w[2] = w(7)
         self.f.fast2locals()
-        assert space.eq_w(self.f.w_locals, self.space.newdict([
-            (w('x'), w(5)),
-            (w('args'), w(7))]))
+        assert space.eq_w(self.f.w_locals, self.space.wrap({'x': 5, 'args': 7}))
 
     def sameList(self, l1, l2):
         assert len(l1) == len(l2) 
@@ -55,18 +52,15 @@
 
     def test_locals2fast(self):
         w = self.space.wrap
-        self.f.w_locals = self.space.newdict([])
+        self.f.w_locals = self.space.wrap({})
         self.f.locals2fast()
         self.sameList(self.f.fastlocals_w, [None]*5)
 
-        self.f.w_locals = self.space.newdict([
-            (w('x'), w(5))])
+        self.f.w_locals = self.space.wrap({'x': 5})
         self.f.locals2fast()
         self.sameList(self.f.fastlocals_w, [w(5)] + [None]*4)
 
-        self.f.w_locals = self.space.newdict([
-            (w('x'), w(5)),
-            (w('args'), w(7))])
+        self.f.w_locals = self.space.wrap({'x':5, 'args':7})
         self.f.locals2fast()
         self.sameList(self.f.fastlocals_w, [w(5), None, w(7),
                                             None, None])

Modified: pypy/dist/pypy/interpreter/test/test_function.py
==============================================================================
--- pypy/dist/pypy/interpreter/test/test_function.py	(original)
+++ pypy/dist/pypy/interpreter/test/test_function.py	Mon Aug 14 19:40:34 2006
@@ -260,7 +260,7 @@
         def c(self, bar):
             return bar
         code = PyCode._from_code(self.space, c.func_code)
-        self.fn = Function(self.space, code, self.space.newdict([]))
+        self.fn = Function(self.space, code, self.space.newdict())
         
     def test_get(self):
         space = self.space
@@ -287,7 +287,7 @@
         # Create some function for this test only
         def m(self): return self
         func = Function(space, PyCode._from_code(self.space, m.func_code),
-                        space.newdict([]))
+                        space.newdict())
         # Some shorthands
         obj1 = space.wrap(23)
         obj2 = space.wrap(42)

Modified: pypy/dist/pypy/interpreter/test/test_gateway.py
==============================================================================
--- pypy/dist/pypy/interpreter/test/test_gateway.py	(original)
+++ pypy/dist/pypy/interpreter/test/test_gateway.py	Mon Aug 14 19:40:34 2006
@@ -39,11 +39,7 @@
                                                    gateway.W_Root,
                                                    'starargs'])
         w = self.space.wrap
-        w_dict = self.space.newdict([
-            (w('x'), w(123)),
-            (w('y'), w(23)),
-            (w('hello'), self.space.newtuple([w(0), w(True)])),
-            ])
+        w_dict = w({'x': 123, 'y': 23, 'hello': (0, True)})
         w_result = code.exec_code(self.space, w_dict, w_dict)
         assert self.space.eq_w(w_result, w(102))
 
@@ -59,12 +55,8 @@
                                                    gateway.W_Root,
                                                    gateway.Arguments])
         w = self.space.wrap
-        w_dict = self.space.newdict([
-            (w('x'), w(123)),
-            (w('y'), w(23)),
-            (w('args'), self.space.newtuple([w(0), w(True)])),
-            (w('keywords'), self.space.newdict([(w('boo'), w(10))])),
-            ])
+        w_dict = w({'x': 123, 'y': 23, 'args': (0, True),
+                    'keywords': {'boo': 10}})
         w_result = code.exec_code(self.space, w_dict, w_dict)
         assert self.space.eq_w(w_result, w(1020))
 
@@ -115,7 +107,7 @@
         assert self.space.eq_w(
             space.call(w_app_g3, 
                        space.newtuple([w('foo'), w('bar')]),
-                       space.newdict([])),
+                       space.newdict()),
             w('foobar'))
         assert self.space.eq_w(
             space.call_function(w_app_g3, w('foo'), w('bar')),
@@ -134,7 +126,7 @@
         assert self.space.eq_w(
             space.call(w_app_g3, 
                        space.newtuple([w('foo'), w('bar')]),
-                       space.newdict([])),
+                       space.newdict()),
             w('foobar'))
         assert self.space.eq_w(
             space.call_function(w_app_g3, w('foo'), w('bar')),
@@ -152,7 +144,7 @@
         assert self.space.eq_w(
             space.call(w_app_g3_args_w, 
                        space.newtuple([w('foo'), w('bar')]),
-                       space.newdict([])),
+                       space.newdict()),
             w('foobar'))
         assert self.space.eq_w(
             space.call_function(w_app_g3_args_w, w('foo'), w('bar')),
@@ -170,7 +162,7 @@
         assert self.space.eq_w(
             space.call(w_app_g3_ss, 
                        space.newtuple([w('foo'), w('bar')]),
-                       space.newdict([])),
+                       space.newdict()),
             w('foobar'))
         assert self.space.eq_w(
             space.call_function(w_app_g3_ss, w('foo'), w('bar')),
@@ -188,7 +180,7 @@
         assert self.space.eq_w(
             space.call(w_app_g3_if, 
                        space.newtuple([w(1), w(1.0)]),
-                       space.newdict([])),
+                       space.newdict()),
             w(2.0))
         assert self.space.eq_w(
             space.call_function(w_app_g3_if, w(1), w(1.0)),

Modified: pypy/dist/pypy/interpreter/test/test_objspace.py
==============================================================================
--- pypy/dist/pypy/interpreter/test/test_objspace.py	(original)
+++ pypy/dist/pypy/interpreter/test/test_objspace.py	Mon Aug 14 19:40:34 2006
@@ -31,12 +31,9 @@
         assert self.space.eq_w(w_l, w(l))
 
     def test_newdict(self):
-        w = self.space.wrap
-        items = [(0, 1), (3, 4)]
-        items_w = [(w(k), w(v)) for (k, v) in items]
-        d = dict(items)
-        w_d = self.space.newdict(items_w)
-        assert self.space.eq_w(w_d, w(d))
+        d = {}
+        w_d = self.space.newdict()
+        assert self.space.eq_w(w_d, self.space.wrap(d))
 
     def test_newtuple(self):
         w = self.space.wrap

Modified: pypy/dist/pypy/interpreter/typedef.py
==============================================================================
--- pypy/dist/pypy/interpreter/typedef.py	(original)
+++ pypy/dist/pypy/interpreter/typedef.py	Mon Aug 14 19:40:34 2006
@@ -172,7 +172,7 @@
             def user_setup(self, space, w_subtype, nslots):
                 self.space = space
                 self.w__class__ = w_subtype
-                self.w__dict__ = space.newdict([])
+                self.w__dict__ = space.newdict()
                 self.user_setup_slots(nslots)
     else:
         supercls = cls

Modified: pypy/dist/pypy/module/__builtin__/compiling.py
==============================================================================
--- pypy/dist/pypy/module/__builtin__/compiling.py	(original)
+++ pypy/dist/pypy/module/__builtin__/compiling.py	Mon Aug 14 19:40:34 2006
@@ -89,7 +89,7 @@
 
     if w_globals is None or space.is_w(w_globals, space.w_None): 
         if caller is None:
-            w_globals = w_locals = space.newdict([])
+            w_globals = w_locals = space.newdict()
         else:
             w_globals = caller.w_globals
             w_locals = caller.getdictscope()

Modified: pypy/dist/pypy/module/__builtin__/test/test_builtin.py
==============================================================================
--- pypy/dist/pypy/module/__builtin__/test/test_builtin.py	(original)
+++ pypy/dist/pypy/module/__builtin__/test/test_builtin.py	Mon Aug 14 19:40:34 2006
@@ -450,7 +450,7 @@
 
         w_execfile = self.get_builtin('execfile')
         space = self.space
-        w_dict = space.newdict([])
+        w_dict = space.newdict()
         self.space.call_function(w_execfile,
             space.wrap(fn), w_dict, space.w_None)
         w_value = space.getitem(w_dict, space.wrap('i'))

Modified: pypy/dist/pypy/module/__builtin__/test/test_import.py
==============================================================================
--- pypy/dist/pypy/module/__builtin__/test/test_import.py	(original)
+++ pypy/dist/pypy/module/__builtin__/test/test_import.py	Mon Aug 14 19:40:34 2006
@@ -315,7 +315,7 @@
         pycode = space.interpclass_w(w_code)
         os.close(fd)
         assert type(pycode) is pypy.interpreter.pycode.PyCode
-        w_dic = space.newdict([])
+        w_dic = space.newdict()
         pycode.exec_code(space, w_dic, w_dic)
         w_ret = space.getitem(w_dic, space.wrap('x'))
         ret = space.int_w(w_ret)
@@ -352,7 +352,7 @@
         osfile.close()
         pycode = space.interpclass_w(w_ret)
         assert type(pycode) is pypy.interpreter.pycode.PyCode
-        w_dic = space.newdict([])
+        w_dic = space.newdict()
         pycode.exec_code(space, w_dic, w_dic)
         w_ret = space.getitem(w_dic, space.wrap('x'))
         ret = space.int_w(w_ret)
@@ -428,7 +428,7 @@
         os.close(fd)
 
         # check value of load
-        w_dic = space.newdict([])
+        w_dic = space.newdict()
         pycode.exec_code(space, w_dic, w_dic)
         w_ret = space.getitem(w_dic, space.wrap('x'))
         ret = space.int_w(w_ret)

Modified: pypy/dist/pypy/module/_pickle_support/maker.py
==============================================================================
--- pypy/dist/pypy/module/_pickle_support/maker.py	(original)
+++ pypy/dist/pypy/module/_pickle_support/maker.py	Mon Aug 14 19:40:34 2006
@@ -26,7 +26,7 @@
 
 def func_new(space):
     fu = instantiate(Function)
-    fu.w_func_dict = space.newdict([])
+    fu.w_func_dict = space.newdict()
     return space.wrap(fu)
 func_new.unwrap_spec = [ObjSpace]
 

Modified: pypy/dist/pypy/module/posix/interp_posix.py
==============================================================================
--- pypy/dist/pypy/module/posix/interp_posix.py	(original)
+++ pypy/dist/pypy/module/posix/interp_posix.py	Mon Aug 14 19:40:34 2006
@@ -238,7 +238,7 @@
 class State:
     def __init__(self, space): 
         self.posix_putenv_garbage = {}
-        self.w_environ = space.newdict([])
+        self.w_environ = space.newdict()
         _convertenviron(space, self.w_environ)
 def get(space): 
     return space.fromcache(State) 

Modified: pypy/dist/pypy/module/sys/state.py
==============================================================================
--- pypy/dist/pypy/module/sys/state.py	(original)
+++ pypy/dist/pypy/module/sys/state.py	Mon Aug 14 19:40:34 2006
@@ -14,7 +14,7 @@
     def __init__(self, space): 
         self.space = space 
 
-        self.w_modules = space.newdict([])
+        self.w_modules = space.newdict()
 
         self.w_warnoptions = space.newlist([])
         self.w_argv = space.newlist([])

Modified: pypy/dist/pypy/module/thread/os_local.py
==============================================================================
--- pypy/dist/pypy/module/thread/os_local.py	(original)
+++ pypy/dist/pypy/module/thread/os_local.py	Mon Aug 14 19:40:34 2006
@@ -17,7 +17,7 @@
         self.space = space
         self.initargs = initargs.normalize()
         ident = thread.get_ident()
-        self.dicts = {ident: space.newdict([])}
+        self.dicts = {ident: space.newdict()}
 
     def getdict(self):
         ident = thread.get_ident()
@@ -26,7 +26,7 @@
         except KeyError:
             # create a new dict for this thread
             space = self.space
-            w_dict = self.dicts[ident] = space.newdict([])
+            w_dict = self.dicts[ident] = space.newdict()
             # call __init__
             try:
                 w_self = space.wrap(self)

Modified: pypy/dist/pypy/objspace/cclp/constraint/constraint.py
==============================================================================
--- pypy/dist/pypy/objspace/cclp/constraint/constraint.py	(original)
+++ pypy/dist/pypy/objspace/cclp/constraint/constraint.py	Mon Aug 14 19:40:34 2006
@@ -81,8 +81,8 @@
                         for var in items]) 
     func_head = 'lambda ' + var_ids + ':'
     expr = func_head + object_space.str_w(w_formula)
-    func_obj = ev(object_space, object_space.wrap(expr), object_space.newdict([]),
-                                 object_space.newdict([]))
+    func_obj = ev(object_space, object_space.wrap(expr), object_space.newdict(),
+                                 object_space.newdict())
     assert isinstance(func_obj, Function)
     return func_obj
 
@@ -112,15 +112,15 @@
 
     def _init_result_cache(self):
         """key = (variable,value), value = [has_success,has_failure]"""
-        result_cache = self._space.newdict([])
+        result_cache = self._space.newdict()
         for var in self._variables:
             assert isinstance(var, W_Variable)
-            result_cache.content[var.w_name()] = self._space.newdict([])
+            result_cache.content[var.w_name()] = self._space.newdict()
         return result_cache
 
     def _assign_values(self):
         variables = []
-        kwargs = self._space.newdict([])
+        kwargs = self._space.newdict()
         for variable in self._variables:
             assert isinstance(variable, W_Variable)
             domain = variable.w_dom

Modified: pypy/dist/pypy/objspace/cclp/constraint/domain.py
==============================================================================
--- pypy/dist/pypy/objspace/cclp/constraint/domain.py	(original)
+++ pypy/dist/pypy/objspace/cclp/constraint/domain.py	Mon Aug 14 19:40:34 2006
@@ -29,7 +29,7 @@
         W_AbstractDomain.__init__(self, space)
         #XXX a pure dict used to work there (esp. in revise)
         assert isinstance(w_values, W_ListObject)
-        self._values = space.newdict([])
+        self._values = space.newdict()
         self.set_values(w_values)
 
 

Modified: pypy/dist/pypy/objspace/cclp/scheduler.py
==============================================================================
--- pypy/dist/pypy/objspace/cclp/scheduler.py	(original)
+++ pypy/dist/pypy/objspace/cclp/scheduler.py	Mon Aug 14 19:40:34 2006
@@ -305,7 +305,7 @@
 
 def sched_info(space):
     sched = scheduler[0]
-    w_ret = space.newdict([])
+    w_ret = space.newdict()
     if not we_are_translated(): # XXX and otherwise, WTF ???
         space.setitem(w_ret, space.wrap('switches'), space.wrap(sched._switch_count))
         space.setitem(w_ret, space.wrap('threads'),
@@ -323,7 +323,7 @@
     s = scheduler[0]
     si = space.setitem
     sw = space.wrap
-    w_ret = space.newdict([])
+    w_ret = space.newdict()
     if not we_are_translated():
         si(w_ret, sw('threads'),
            sw([id(th) for th in s.get_threads()]))

Modified: pypy/dist/pypy/objspace/constraint/constraint.py
==============================================================================
--- pypy/dist/pypy/objspace/constraint/constraint.py	(original)
+++ pypy/dist/pypy/objspace/constraint/constraint.py	Mon Aug 14 19:40:34 2006
@@ -182,8 +182,8 @@
                         for var in items]) 
     func_head = 'lambda ' + var_ids + ':'
     expr = func_head + object_space.str_w(w_formula)
-    func_obj = ev(object_space, object_space.wrap(expr), object_space.newdict([]),
-                                 object_space.newdict([]))
+    func_obj = ev(object_space, object_space.wrap(expr), object_space.newdict(),
+                                 object_space.newdict())
     assert isinstance(func_obj, Function)
     return func_obj
 
@@ -213,15 +213,15 @@
 
     def _init_result_cache(self):
         """key = (variable,value), value = [has_success,has_failure]"""
-        result_cache = self._space.newdict([])
+        result_cache = self._space.newdict()
         for var in self._variables:
             assert isinstance(var, W_Variable)
-            result_cache.content[var.w_name()] = self._space.newdict([])
+            result_cache.content[var.w_name()] = self._space.newdict()
         return result_cache
 
     def _assign_values(self, w_cs):
         variables = []
-        kwargs = self._space.newdict([])
+        kwargs = self._space.newdict()
         for variable in self._variables:
             assert isinstance(variable, W_Variable)
             domain = w_cs.w_dom(variable)

Modified: pypy/dist/pypy/objspace/cpy/objspace.py
==============================================================================
--- pypy/dist/pypy/objspace/cpy/objspace.py	(original)
+++ pypy/dist/pypy/objspace/cpy/objspace.py	Mon Aug 14 19:40:34 2006
@@ -150,8 +150,10 @@
     def call_args(self, w_callable, args):
         args_w, kwds_w = args.unpack()
         w_args = self.newtuple(args_w)
-        w_kwds = self.newdict([(self.wrap(key), w_value)
-                               for key, w_value in kwds_w.items()])
+        w_kwds = self.newdict()
+        for key, w_value in kwds_w.items():
+            w_key = self.wrap(key)
+            PyDict_SetItem(w_kwds, w_key, w_value)
         return PyObject_Call(w_callable, w_args, w_kwds)
 
     def new_interned_str(self, s):
@@ -176,11 +178,8 @@
     def newint(self, intval):
         return PyInt_FromLong(intval)
 
-    def newdict(self, items_w):
-        w_dict = PyDict_New()
-        for w_key, w_value in items_w:
-            PyDict_SetItem(w_dict, w_key, w_value)
-        return w_dict
+    def newdict(self):
+        return PyDict_New()
 
     def newlist(self, items_w):
         n = len(items_w)

Modified: pypy/dist/pypy/objspace/cpy/test/test_objspace.py
==============================================================================
--- pypy/dist/pypy/objspace/cpy/test/test_objspace.py	(original)
+++ pypy/dist/pypy/objspace/cpy/test/test_objspace.py	Mon Aug 14 19:40:34 2006
@@ -6,7 +6,8 @@
     space = CPyObjSpace()
     wk1 = space.wrap('key')
     wone = space.wrap(1)
-    d = space.newdict([(space.wrap('zero'),space.wrap(0))])
+    d = space.newdict()
+    space.setitem(d,space.wrap('zero'),space.wrap(0))
     space.setitem(d,wk1,wone)
     wback = space.getitem(d,wk1)
     assert space.eq_w(wback,wone)

Modified: pypy/dist/pypy/objspace/cpy/test/test_typedef.py
==============================================================================
--- pypy/dist/pypy/objspace/cpy/test/test_typedef.py	(original)
+++ pypy/dist/pypy/objspace/cpy/test/test_typedef.py	Mon Aug 14 19:40:34 2006
@@ -330,7 +330,7 @@
 
     w_type = space.gettypefor(W_MyType)
     w_obj = space.call_function(w_type, space.wrap(42))
-    w_mydict = space.newdict([])
+    w_mydict = space.newdict()
     space.setitem(w_mydict, space.wrap('hello'), w_obj)
     def build():
         return w_mydict

Modified: pypy/dist/pypy/objspace/flow/objspace.py
==============================================================================
--- pypy/dist/pypy/objspace/flow/objspace.py	(original)
+++ pypy/dist/pypy/objspace/flow/objspace.py	Mon Aug 14 19:40:34 2006
@@ -80,16 +80,10 @@
         self.executioncontext.recorder = previous_recorder
         self.concrete_mode -= 1
 
-    def newdict(self, items_w):
+    def newdict(self):
         if self.concrete_mode:
-            content = [(self.unwrap(w_key), self.unwrap(w_value))
-                       for w_key, w_value in items_w]
-            return Constant(dict(content))
-        flatlist_w = []
-        for w_key, w_value in items_w:
-            flatlist_w.append(w_key)
-            flatlist_w.append(w_value)
-        return self.do_operation('newdict', *flatlist_w)
+            return Constant({})
+        return self.do_operation('newdict')
 
     def newtuple(self, args_w):
         try:

Modified: pypy/dist/pypy/objspace/flow/test/test_framestate.py
==============================================================================
--- pypy/dist/pypy/objspace/flow/test/test_framestate.py	(original)
+++ pypy/dist/pypy/objspace/flow/test/test_framestate.py	Mon Aug 14 19:40:34 2006
@@ -19,7 +19,7 @@
             pass
         code = func.func_code
         code = PyCode._from_code(self.space, code)
-        w_globals = Constant({}) # space.newdict([])
+        w_globals = Constant({}) # space.newdict()
         frame = code.create_frame(space, w_globals)
 
         formalargcount = code.getformalargcount()

Modified: pypy/dist/pypy/objspace/std/marshal_impl.py
==============================================================================
--- pypy/dist/pypy/objspace/std/marshal_impl.py	(original)
+++ pypy/dist/pypy/objspace/std/marshal_impl.py	Mon Aug 14 19:40:34 2006
@@ -364,7 +364,7 @@
     # since primitive lists are not optimized and we don't know
     # the dict size in advance, use the dict's setitem instead
     # of building a list of tuples.
-    w_dic = space.newdict([])
+    w_dic = space.newdict()
     while 1:
         w_key = u.get_w_obj(True)
         if w_key is None:

Modified: pypy/dist/pypy/objspace/std/objspace.py
==============================================================================
--- pypy/dist/pypy/objspace/std/objspace.py	(original)
+++ pypy/dist/pypy/objspace/std/objspace.py	Mon Aug 14 19:40:34 2006
@@ -247,7 +247,7 @@
     def createexecutioncontext(self):
         # add space specific fields to execution context
         ec = ObjSpace.createexecutioncontext(self)
-        ec._py_repr = self.newdict([])
+        ec._py_repr = self.newdict()
         return ec
 
     def gettypefor(self, cls):
@@ -284,7 +284,9 @@
             return W_UnicodeObject([unichr(ord(u)) for u in x]) # xxx
         if isinstance(x, dict):
             items_w = [(self.wrap(k), self.wrap(v)) for (k, v) in x.iteritems()]
-            return self.newdict(items_w)
+            r = self.newdict()
+            r.initialize_content(items_w)
+            return r
         if isinstance(x, float):
             return W_FloatObject(x)
         if isinstance(x, tuple):
@@ -386,10 +388,8 @@
     def newlist(self, list_w):
         return W_ListObject(list_w)
 
-    def newdict(self, list_pairs_w):
-        w_result = self.DictObjectCls(self)
-        w_result.initialize_content(list_pairs_w)
-        return w_result
+    def newdict(self):
+        return self.DictObjectCls(self)
 
     def newslice(self, w_start, w_end, w_step):
         return W_SliceObject(w_start, w_end, w_step)

Modified: pypy/dist/pypy/objspace/std/stdtypedef.py
==============================================================================
--- pypy/dist/pypy/objspace/std/stdtypedef.py	(original)
+++ pypy/dist/pypy/objspace/std/stdtypedef.py	Mon Aug 14 19:40:34 2006
@@ -37,7 +37,7 @@
     return True
 
 def descr_del_dict(space, w_obj): # blame CPython for the existence of this one
-    w_obj.setdict(space, space.newdict([]))
+    w_obj.setdict(space, space.newdict())
 
 std_dict_descr = GetSetProperty(descr_get_dict, descr_set_dict, descr_del_dict)
 std_dict_descr.name = '__dict__'

Modified: pypy/dist/pypy/objspace/std/test/test_dictobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/test/test_dictobject.py	(original)
+++ pypy/dist/pypy/objspace/std/test/test_dictobject.py	Mon Aug 14 19:40:34 2006
@@ -52,20 +52,27 @@
     def test_dict_compare(self):
         w = self.space.wrap
         w0, w1, w2, w3 = map(w, range(4))
-        wd1 = self.space.newdict([(w0, w1), (w2, w3)])
-        wd2 = self.space.newdict([(w2, w3), (w0, w1)])
+        def wd(items):
+            d = self.space.newdict()
+            d.initialize_content(items)
+            return d
+        wd1 = wd([(w0, w1), (w2, w3)])
+        wd2 = wd([(w2, w3), (w0, w1)])
         assert self.space.eq_w(wd1, wd2)
-        wd3 = self.space.newdict([(w2, w2), (w0, w1)])
+        wd3 = wd([(w2, w2), (w0, w1)])
         assert not self.space.eq_w(wd1, wd3)
-        wd4 = self.space.newdict([(w3, w3), (w0, w1)])
+        wd4 = wd([(w3, w3), (w0, w1)])
         assert not self.space.eq_w(wd1, wd4)
-        wd5 = self.space.newdict([(w3, w3)])
+        wd5 = wd([(w3, w3)])
         assert not self.space.eq_w(wd1, wd4)
 
     def test_dict_call(self):
         space = self.space
         w = space.wrap
-        wd = space.newdict
+        def wd(items):
+            d = space.newdict()
+            d.initialize_content(items)
+            return d
         def mydict(w_args=w(()), w_kwds=w({})):
             return space.call(space.w_dict, w_args, w_kwds)
         def deepwrap(lp):
@@ -85,7 +92,6 @@
     def test_dict_pop(self):
         space = self.space
         w = space.wrap
-        wd = space.newdict
         def mydict(w_args=w(()), w_kwds=w({})):
             return space.call(space.w_dict, w_args, w_kwds)
         d = mydict(w_kwds=w({"1":2, "3":4}))

Modified: pypy/dist/pypy/objspace/std/typeobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/typeobject.py	(original)
+++ pypy/dist/pypy/objspace/std/typeobject.py	Mon Aug 14 19:40:34 2006
@@ -73,7 +73,7 @@
                 try:
                     caller = space.getexecutioncontext().framestack.top()
                 except IndexError:
-                    w_globals = w_locals = space.newdict([])
+                    w_globals = w_locals = space.newdict()
                 else:
                     w_globals = caller.w_globals
                     w_str_name = space.wrap('__name__')
@@ -302,7 +302,9 @@
         dictspec = []
         for key, w_value in w_self.dict_w.items():
             dictspec.append((space.wrap(key), w_value))
-        return W_DictProxyObject(space.newdict(dictspec))
+        newdic = space.newdict()
+        newdic.initialize_content(dictspec)
+        return W_DictProxyObject(newdic)
 
     def unwrap(w_self):
         if w_self.instancetypedef.fakedcpytype is not None:

Modified: pypy/dist/pypy/rpython/callparse.py
==============================================================================
--- pypy/dist/pypy/rpython/callparse.py	(original)
+++ pypy/dist/pypy/rpython/callparse.py	Mon Aug 14 19:40:34 2006
@@ -167,7 +167,7 @@
     def newtuple(self, items):
         return NewTupleHolder(items)
 
-    def newdict(self, stuff):
+    def newdict(self):
         raise CallPatternTooComplex, "'**' argument"
 
     def unpackiterable(self, it, expected_length=None):

Modified: pypy/dist/pypy/tool/pytest/appsupport.py
==============================================================================
--- pypy/dist/pypy/tool/pytest/appsupport.py	(original)
+++ pypy/dist/pypy/tool/pytest/appsupport.py	Mon Aug 14 19:40:34 2006
@@ -132,7 +132,7 @@
                                                 unwrap_spec=[gateway.ObjSpace,
                                                              gateway.W_Root,
                                                              gateway.Arguments]))
-    w_dict = space.newdict([])
+    w_dict = space.newdict()
     space.setitem(w_dict, space.wrap('__init__'), w_init)
     return space.call_function(w_metaclass,
                                space.wrap('AssertionError'),

Modified: pypy/dist/pypy/tool/test/test_pytestsupport.py
==============================================================================
--- pypy/dist/pypy/tool/test/test_pytestsupport.py	(original)
+++ pypy/dist/pypy/tool/test/test_pytestsupport.py	Mon Aug 14 19:40:34 2006
@@ -14,7 +14,7 @@
 def test_AppFrame(space):
     import sys
     co = PyCode._from_code(space, somefunc.func_code)
-    pyframe = PyFrame(space, co, space.newdict([]), None)
+    pyframe = PyFrame(space, co, space.newdict(), None)
     runner = AppFrame(pyframe)
     exprinfo.run("f = lambda x: x+1", runner)
     msg = exprinfo.interpret("assert isinstance(f(2), float)", runner)

Modified: pypy/dist/pypy/translator/geninterplevel.py
==============================================================================
--- pypy/dist/pypy/translator/geninterplevel.py	(original)
+++ pypy/dist/pypy/translator/geninterplevel.py	Mon Aug 14 19:40:34 2006
@@ -101,7 +101,7 @@
     unique = self.uniquenameofprebuilt("eval_helper", eval_helper)
     self.initcode.append1(
         'def %s(expr):\n'
-        '    dic = space.newdict([])\n'
+        '    dic = space.newdict()\n'
         '    if "types." in expr:\n'
         '        space.exec_("import types", dic, dic)\n'
         '    else:\n'
@@ -114,7 +114,7 @@
     unique = self.uniquenameofprebuilt("unpickle_helper", unpickle_helper)
     self.initcode.append1(
         'def %s(value):\n'
-        '    dic = space.newdict([])\n'
+        '    dic = space.newdict()\n'
         '    space.exec_("import cPickle as pickle", dic, dic)\n'
         '    return space.eval("pickle.loads(%%r)" %% value, dic, dic)' % unique)
     self.initcode.append1('%s = %s(%r)' % (
@@ -125,7 +125,7 @@
     unique = self.uniquenameofprebuilt("long_helper", long_helper)
     self.initcode.append1(
         'def %s(value):\n'
-        '    dic = space.newdict([])\n'
+        '    dic = space.newdict()\n'
         '    space.exec_("", dic, dic) # init __builtins__\n'
         '    return space.eval(value, dic, dic)' % unique)
     self.initcode.append1('%s = %s(%r)' % (
@@ -136,7 +136,7 @@
     unique = self.uniquenameofprebuilt("bltinmod_helper", bltinmod_helper)
     self.initcode.append1(
         'def %s(name):\n'
-        '    dic = space.newdict([])\n'
+        '    dic = space.newdict()\n'
         '    space.exec_("import %%s" %% name, dic, dic)\n'
         '    return space.eval("%%s" %% name, dic, dic)' % (unique, ))
     self.initcode.append1('%s = %s(%r)' % (name, unique, mod.__name__))
@@ -183,7 +183,7 @@
 
         # special constructors:
         self.has_listarg = {}
-        for name in "newtuple newlist newdict newstring".split():
+        for name in "newtuple newlist newstring".split():
             self.has_listarg[name] = name
 
         # catching all builtins in advance, to avoid problems
@@ -798,7 +798,7 @@
                     name, self.nameof(key), self.nameof(value))
 
         baseargs = ", ".join(basenames)
-        initcode.append('_dic = space.newdict([])')
+        initcode.append('_dic = space.newdict()')
         for key, value in cls.__dict__.items():
             if key.startswith('__'):
                 if key in ['__module__', '__metaclass__', '__slots__',
@@ -934,7 +934,7 @@
         assert dic is not __builtins__
         name = self.uniquename('g%ddict' % len(dic))
         self.register_early(dic, name)
-        self.initcode.append('%s = space.newdict([])' % (name,))
+        self.initcode.append('%s = space.newdict()' % (name,))
         for k in dic:
             if k == '__builtins__':
                 continue

Modified: pypy/dist/pypy/translator/goal/targetlogicstandalone.py
==============================================================================
--- pypy/dist/pypy/translator/goal/targetlogicstandalone.py	(original)
+++ pypy/dist/pypy/translator/goal/targetlogicstandalone.py	Mon Aug 14 19:40:34 2006
@@ -97,7 +97,7 @@
 
     # manually imports app_main.py
     filename = os.path.join(this_dir, 'app_main.py')
-    w_dict = space.newdict([])
+    w_dict = space.newdict()
     space.exec_(open(filename).read(), w_dict, w_dict)
     w_entry_point = space.getitem(w_dict, space.wrap('entry_point'))
 

Modified: pypy/dist/pypy/translator/goal/targetmultiplespaces.py
==============================================================================
--- pypy/dist/pypy/translator/goal/targetmultiplespaces.py	(original)
+++ pypy/dist/pypy/translator/goal/targetmultiplespaces.py	Mon Aug 14 19:40:34 2006
@@ -123,11 +123,11 @@
 
     # manually imports app_main.py
     filename = os.path.join(this_dir, 'app_main.py')
-    w_dict = space1.newdict([])
+    w_dict = space1.newdict()
     space1.exec_(open(filename).read(), w_dict, w_dict)
     w_entry_point_1 = space1.getitem(w_dict, space1.wrap('entry_point'))
 
-    w_dict = space2.newdict([])
+    w_dict = space2.newdict()
     space2.exec_(open(filename).read(), w_dict, w_dict)
     w_entry_point_2 = space2.getitem(w_dict, space2.wrap('entry_point'))
 

Modified: pypy/dist/pypy/translator/goal/targetpypymain.py
==============================================================================
--- pypy/dist/pypy/translator/goal/targetpypymain.py	(original)
+++ pypy/dist/pypy/translator/goal/targetpypymain.py	Mon Aug 14 19:40:34 2006
@@ -104,7 +104,7 @@
 
     # manually imports app_main.py
     filename = os.path.join(this_dir, 'app_main.py')
-    w_dict = space.newdict([])
+    w_dict = space.newdict()
     space.exec_(open(filename).read(), w_dict, w_dict)
     w_entry_point = space.getitem(w_dict, space.wrap('entry_point'))
 

Modified: pypy/dist/pypy/translator/goal/targetpypystandalone.py
==============================================================================
--- pypy/dist/pypy/translator/goal/targetpypystandalone.py	(original)
+++ pypy/dist/pypy/translator/goal/targetpypystandalone.py	Mon Aug 14 19:40:34 2006
@@ -134,7 +134,7 @@
 
     # manually imports app_main.py
     filename = os.path.join(this_dir, 'app_main.py')
-    w_dict = space.newdict([])
+    w_dict = space.newdict()
     space.exec_(open(filename).read(), w_dict, w_dict)
     entry_point = create_entry_point(space, w_dict)
 

Modified: pypy/dist/pypy/translator/goal/targetthunkstandalone.py
==============================================================================
--- pypy/dist/pypy/translator/goal/targetthunkstandalone.py	(original)
+++ pypy/dist/pypy/translator/goal/targetthunkstandalone.py	Mon Aug 14 19:40:34 2006
@@ -97,7 +97,7 @@
 
     # manually imports app_main.py
     filename = os.path.join(this_dir, 'app_main.py')
-    w_dict = space.newdict([])
+    w_dict = space.newdict()
     space.exec_(open(filename).read(), w_dict, w_dict)
     w_entry_point = space.getitem(w_dict, space.wrap('entry_point'))
 

Modified: pypy/dist/pypy/translator/pyrex/genpyrex.py
==============================================================================
--- pypy/dist/pypy/translator/pyrex/genpyrex.py	(original)
+++ pypy/dist/pypy/translator/pyrex/genpyrex.py	Mon Aug 14 19:40:34 2006
@@ -106,10 +106,7 @@
             return "%s = []" % self.resultname
 
     def op_newdict(self):
-        pairs = []
-        for i in range(0, len(self.argnames), 2):
-            pairs.append("%s: %s, " % (self.argnames[i], self.argnames[i+1]))
-        return "%s = {%s}" % (self.resultname, "".join(pairs))
+        return "%s = {}" % (self.resultname,)
 
     def op_newslice(self):
         a = self.argnames



More information about the Pypy-commit mailing list