[pypy-commit] pypy arm-backend-2: merge up to 9ccaeaff6e07

bivab noreply at buildbot.pypy.org
Fri Jul 1 14:18:30 CEST 2011


Author: David Schneider <david.schneider at picle.org>
Branch: arm-backend-2
Changeset: r45214:1372220cf8f6
Date: 2011-06-30 16:00 +0200
http://bitbucket.org/pypy/pypy/changeset/1372220cf8f6/

Log:	merge up to 9ccaeaff6e07

diff --git a/pypy/doc/_ref.txt b/pypy/doc/_ref.txt
--- a/pypy/doc/_ref.txt
+++ b/pypy/doc/_ref.txt
@@ -1,3 +1,4 @@
+.. _`ctypes_configure/doc/sample.py`: https://bitbucket.org/pypy/pypy/src/default/ctypes_configure/doc/sample.py
 .. _`demo/`: https://bitbucket.org/pypy/pypy/src/default/demo/
 .. _`demo/pickle_coroutine.py`: https://bitbucket.org/pypy/pypy/src/default/demo/pickle_coroutine.py
 .. _`lib-python/`: https://bitbucket.org/pypy/pypy/src/default/lib-python/
diff --git a/pypy/doc/ctypes-implementation.rst b/pypy/doc/ctypes-implementation.rst
--- a/pypy/doc/ctypes-implementation.rst
+++ b/pypy/doc/ctypes-implementation.rst
@@ -137,7 +137,27 @@
 ctypes configure
 =================
 
-We also released `ctypes-configure`_, which is an experimental package trying to
-approach the portability issues of ctypes-based code.
+We also released ``ctypes-configure``, which is an experimental package
+trying to approach the portability issues of ctypes-based code.
 
-.. _`ctypes-configure`: http://codespeak.net/~fijal/configure.html
+idea
+----
+
+One of ctypes problems is that ctypes programs are usually not very
+platform-independent. We created ctypes_configure, which invokes c
+compiler (via distutils) for various platform-dependent details like
+exact sizes of types (for example size_t), ``#defines``, exact outline of
+structures etc. It replaces in this regard code generator (h2py).
+
+installation
+------------
+
+``easy_install ctypes_configure``
+
+usage
+-----
+
+`ctypes_configure/doc/sample.py`_ explains in details how to use it.
+
+
+.. include:: _ref.txt
diff --git a/pypy/doc/extending.rst b/pypy/doc/extending.rst
--- a/pypy/doc/extending.rst
+++ b/pypy/doc/extending.rst
@@ -42,7 +42,7 @@
 platform-dependent details (compiling small snippets of C code and running
 them), so it'll benefit not pypy-related ctypes-based modules as well.
 
-.. _`ctypes-configure`: http://codespeak.net/~fijal/configure.html
+.. _`ctypes-configure`: ctypes-implementation.html#ctypes-configure
 
 Pros
 ----
diff --git a/pypy/doc/getting-started-python.rst b/pypy/doc/getting-started-python.rst
--- a/pypy/doc/getting-started-python.rst
+++ b/pypy/doc/getting-started-python.rst
@@ -300,6 +300,6 @@
 .. _`CLI backend`: cli-backend.html
 .. _`Boehm-Demers-Weiser garbage collector`: http://www.hpl.hp.com/personal/Hans_Boehm/gc/
 .. _clr: clr-module.html
-.. _`CPythons core language regression tests`: http://codespeak.net:8099/summary?category=applevel&branch=%3Ctrunk%3E
+.. _`CPythons core language regression tests`: http://buildbot.pypy.org/summary?category=applevel&branch=%3Ctrunk%3E
 
 .. include:: _ref.txt
diff --git a/pypy/doc/index.rst b/pypy/doc/index.rst
--- a/pypy/doc/index.rst
+++ b/pypy/doc/index.rst
@@ -141,15 +141,6 @@
 You can also find CPython's compliance tests run with compiled ``pypy-c``
 executables there.
 
-information dating from early 2007: 
-
-`PyPy LOC statistics`_ shows LOC statistics about PyPy.
-
-`PyPy statistics`_ is a page with various statistics about the PyPy project.
-
-`compatibility matrix`_ is a diagram that shows which of the various features
-of the PyPy interpreter work together with which other features.
-
 
 Source Code Documentation
 ===============================================
@@ -207,8 +198,6 @@
 .. _`development methodology`: dev_method.html
 .. _`sprint reports`: sprint-reports.html
 .. _`papers, talks and related projects`: extradoc.html
-.. _`PyPy LOC statistics`: http://codespeak.net/~hpk/pypy-stat/
-.. _`PyPy statistics`: http://codespeak.net/pypy/trunk/pypy/doc/statistic
 .. _`object spaces`: objspace.html 
 .. _`interpreter optimizations`: interpreter-optimizations.html 
 .. _`translation`: translation.html 
@@ -222,7 +211,7 @@
 .. _`bytecode interpreter`: interpreter.html 
 .. _`EU reports`: index-report.html
 .. _`Technical reports`: index-report.html
-.. _`summary`: http://codespeak.net:8099/summary
+.. _`summary`: http://buildbot.pypy.org/summary
 .. _`ideas for PyPy related projects`: project-ideas.html
 .. _`Nightly builds and benchmarks`: http://tuatara.cs.uni-duesseldorf.de/benchmark.html
 .. _`directory reference`: 
@@ -360,7 +349,6 @@
 .. _Mono: http://www.mono-project.com/
 .. _`"standard library"`: rlib.html
 .. _`graph viewer`: getting-started-dev.html#try-out-the-translator
-.. _`compatibility matrix`: image/compat-matrix.png
 
 
 .. The following documentation is important and reasonably up-to-date:
diff --git a/pypy/doc/video-index.rst b/pypy/doc/video-index.rst
--- a/pypy/doc/video-index.rst
+++ b/pypy/doc/video-index.rst
@@ -42,11 +42,11 @@
 Trailer: PyPy at the PyCon 2006
 -------------------------------
 
-130mb: http://codespeak.net/download/pypy/video/pycon-trailer.avi.torrent
+130mb: http://wyvern.cs.uni-duesseldorf.de/torrent/pycon-trailer.avi.torrent
 
-71mb: http://codespeak.net/download/pypy/video/pycon-trailer-medium.avi.torrent
+71mb: http://wyvern.cs.uni-duesseldorf.de/torrent/pycon-trailer-medium.avi.torrent
 
-50mb: http://codespeak.net/download/pypy/video/pycon-trailer-320x240.avi.torrent
+50mb: http://wyvern.cs.uni-duesseldorf.de/torrent/pycon-trailer-320x240.avi.torrent
 
 .. image:: image/pycon-trailer.jpg
    :scale: 100
@@ -62,9 +62,9 @@
 Interview with Tim Peters
 -------------------------
 
-440mb: http://codespeak.net/download/pypy/video/interview-timpeters-v2.avi.torrent
+440mb: http://wyvern.cs.uni-duesseldorf.de/torrent/interview-timpeters-v2.avi.torrent
 
-138mb: http://codespeak.net/download/pypy/video/interview-timpeters-320x240.avi.torrent
+138mb: http://wyvern.cs.uni-duesseldorf.de/torrent/interview-timpeters-320x240.avi.torrent
 
 .. image:: image/interview-timpeters.jpg
    :scale: 100
@@ -82,9 +82,9 @@
 Interview with Bob Ippolito
 ---------------------------
 
-155mb: http://codespeak.net/download/pypy/video/interview-bobippolito-v2.avi.torrent
+155mb: http://wyvern.cs.uni-duesseldorf.de/torrent/interview-bobippolito-v2.avi.torrent
 
-50mb: http://codespeak.net/download/pypy/video/interview-bobippolito-320x240.avi.torrent
+50mb: http://wyvern.cs.uni-duesseldorf.de/torrent/interview-bobippolito-320x240.avi.torrent
 
 .. image:: image/interview-bobippolito.jpg
    :scale: 100
@@ -102,9 +102,9 @@
 Introductory talk on PyPy
 -------------------------
 
-430mb: http://codespeak.net/download/pypy/video/introductory-talk-pycon-v1.avi.torrent
+430mb: http://wyvern.cs.uni-duesseldorf.de/torrent/introductory-talk-pycon-v1.avi.torrent
 
-166mb: http://codespeak.net/download/pypy/video/introductory-talk-pycon-320x240.avi.torrent
+166mb: http://wyvern.cs.uni-duesseldorf.de/torrent/introductory-talk-pycon-320x240.avi.torrent
 
 .. image:: image/introductory-talk-pycon.jpg
    :scale: 100
@@ -125,9 +125,9 @@
 Talk on Agile Open Source Methods in the PyPy project
 -----------------------------------------------------
 
-395mb: http://codespeak.net/download/pypy/video/agile-talk-v1.avi.torrent
+395mb: http://wyvern.cs.uni-duesseldorf.de/torrent/agile-talk-v1.avi.torrent
 
-153mb: http://codespeak.net/download/pypy/video/agile-talk-320x240.avi.torrent
+153mb: http://wyvern.cs.uni-duesseldorf.de/torrent/agile-talk-320x240.avi.torrent
 
 .. image:: image/agile-talk.jpg
    :scale: 100
@@ -148,9 +148,9 @@
 PyPy Architecture session
 -------------------------
 
-744mb: http://codespeak.net/download/pypy/video/architecture-session-v1.avi.torrent
+744mb: http://wyvern.cs.uni-duesseldorf.de/torrent/architecture-session-v1.avi.torrent
 
-288mb: http://codespeak.net/download/pypy/video/architecture-session-320x240.avi.torrent
+288mb: http://wyvern.cs.uni-duesseldorf.de/torrent/architecture-session-320x240.avi.torrent
 
 .. image:: image/architecture-session.jpg
    :scale: 100
@@ -171,9 +171,9 @@
 Sprint tutorial
 ---------------
 
-680mb: http://codespeak.net/download/pypy/video/sprint-tutorial-v2.avi.torrent
+680mb: http://wyvern.cs.uni-duesseldorf.de/torrent/sprint-tutorial-v2.avi.torrent
 
-263mb: http://codespeak.net/download/pypy/video/sprint-tutorial-320x240.avi.torrent
+263mb: http://wyvern.cs.uni-duesseldorf.de/torrent/sprint-tutorial-320x240.avi.torrent
 
 .. image:: image/sprint-tutorial.jpg
    :scale: 100
@@ -190,9 +190,9 @@
 Scripting .NET with IronPython by Jim Hugunin
 ---------------------------------------------
 
-372mb: http://codespeak.net/download/pypy/video/ironpython-talk-v2.avi.torrent
+372mb: http://wyvern.cs.uni-duesseldorf.de/torrent/ironpython-talk-v2.avi.torrent
 
-270mb: http://codespeak.net/download/pypy/video/ironpython-talk-320x240.avi.torrent
+270mb: http://wyvern.cs.uni-duesseldorf.de/torrent/ironpython-talk-320x240.avi.torrent
 
 .. image:: image/ironpython.jpg
    :scale: 100
@@ -209,9 +209,9 @@
 Bram Cohen, founder and developer of BitTorrent
 -----------------------------------------------
 
-509mb: http://codespeak.net/download/pypy/video/bram-cohen-interview-v1.avi.torrent
+509mb: http://wyvern.cs.uni-duesseldorf.de/torrent/bram-cohen-interview-v1.avi.torrent
 
-370mb: http://codespeak.net/download/pypy/video/bram-cohen-interview-320x240.avi.torrent
+370mb: http://wyvern.cs.uni-duesseldorf.de/torrent/bram-cohen-interview-320x240.avi.torrent
 
 .. image:: image/bram.jpg
    :scale: 100
@@ -226,9 +226,9 @@
 Keynote speech by Guido van Rossum on the new Python 2.5 features
 -----------------------------------------------------------------
 
-695mb: http://codespeak.net/download/pypy/video/keynote-speech_guido-van-rossum_v1.avi.torrent
+695mb: http://wyvern.cs.uni-duesseldorf.de/torrent/keynote-speech_guido-van-rossum_v1.avi.torrent
 
-430mb: http://codespeak.net/download/pypy/video/keynote-speech_guido-van-rossum_320x240.avi.torrent
+430mb: http://wyvern.cs.uni-duesseldorf.de/torrent/keynote-speech_guido-van-rossum_320x240.avi.torrent
 
 .. image:: image/guido.jpg
    :scale: 100
@@ -243,11 +243,11 @@
 Trailer: PyPy sprint at the University of Palma de Mallorca
 -----------------------------------------------------------
 
-166mb: http://codespeak.net/download/pypy/video/mallorca-trailer-v1.avi.torrent
+166mb: http://wyvern.cs.uni-duesseldorf.de/torrent/mallorca-trailer-v1.avi.torrent
 
-88mb: http://codespeak.net/download/pypy/video/mallorca-trailer-medium.avi.torrent
+88mb: http://wyvern.cs.uni-duesseldorf.de/torrent/mallorca-trailer-medium.avi.torrent
 
-64mb: http://codespeak.net/download/pypy/video/mallorca-trailer-320x240.avi.torrent
+64mb: http://wyvern.cs.uni-duesseldorf.de/torrent/mallorca-trailer-320x240.avi.torrent
 
 .. image:: image/mallorca-trailer.jpg
    :scale: 100
@@ -262,9 +262,9 @@
 Coding discussion of core developers Armin Rigo and Samuele Pedroni
 -------------------------------------------------------------------
 
-620mb: http://codespeak.net/download/pypy/video/coding-discussion-v1.avi.torrent
+620mb: http://wyvern.cs.uni-duesseldorf.de/torrent/coding-discussion-v1.avi.torrent
 
-240mb: http://codespeak.net/download/pypy/video/coding-discussion-320x240.avi.torrent
+240mb: http://wyvern.cs.uni-duesseldorf.de/torrent/coding-discussion-320x240.avi.torrent
 
 .. image:: image/coding-discussion.jpg
    :scale: 100
@@ -279,9 +279,9 @@
 PyPy technical talk at the University of Palma de Mallorca
 ----------------------------------------------------------
 
-865mb: http://codespeak.net/download/pypy/video/introductory-student-talk-v2.avi.torrent
+865mb: http://wyvern.cs.uni-duesseldorf.de/torrent/introductory-student-talk-v2.avi.torrent
 
-437mb: http://codespeak.net/download/pypy/video/introductory-student-talk-320x240.avi.torrent
+437mb: http://wyvern.cs.uni-duesseldorf.de/torrent/introductory-student-talk-320x240.avi.torrent
 
 .. image:: image/introductory-student-talk.jpg
    :scale: 100
diff --git a/pypy/module/cpyext/test/test_cpyext.py b/pypy/module/cpyext/test/test_cpyext.py
--- a/pypy/module/cpyext/test/test_cpyext.py
+++ b/pypy/module/cpyext/test/test_cpyext.py
@@ -304,7 +304,12 @@
             self.unimport_module(name)
         self.cleanup_references(self.space)
         if self.check_and_print_leaks():
-            assert False, "Test leaks or loses object(s)."
+            assert False, (
+                "Test leaks or loses object(s).  You should also check if "
+                "the test actually passed in the first place; if it failed "
+                "it is likely to reach this place.")
+            # XXX find out how to disable check_and_print_leaks() if the
+            # XXX test failed...
 
 
 class AppTestCpythonExtension(AppTestCpythonExtensionBase):
diff --git a/pypy/module/cpyext/test/test_structseq.py b/pypy/module/cpyext/test/test_structseq.py
--- a/pypy/module/cpyext/test/test_structseq.py
+++ b/pypy/module/cpyext/test/test_structseq.py
@@ -30,6 +30,7 @@
              """
                  PyObject *seq;
                  PyStructSequence_InitType(&PyDatatype, &Data_desc);
+                 if (PyErr_Occurred()) return NULL;
                  seq = PyStructSequence_New(&PyDatatype);
                  if (!seq) return NULL;
                  PyStructSequence_SET_ITEM(seq, 0, PyInt_FromLong(42));
diff --git a/pypy/objspace/std/dictproxyobject.py b/pypy/objspace/std/dictproxyobject.py
--- a/pypy/objspace/std/dictproxyobject.py
+++ b/pypy/objspace/std/dictproxyobject.py
@@ -29,7 +29,18 @@
             raise OperationError(space.w_TypeError, space.wrap("cannot add non-string keys to dict of a type"))
 
     def impl_setitem_str(self, name, w_value):
-        self.w_type.setdictvalue(self.space, name, w_value)
+        try:
+            self.w_type.setdictvalue(self.space, name, w_value)
+        except OperationError, e:
+            if not e.match(self.space, self.space.w_TypeError):
+                raise
+            w_type = self.w_type
+            if not w_type.is_cpytype():
+                raise
+            # xxx obscure workaround: allow cpyext to write to type->tp_dict.
+            # xxx like CPython, we assume that this is only done early after
+            # xxx the type is created, and we don't invalidate any cache.
+            w_type.dict_w[name] = w_value
 
     def impl_setdefault(self, w_key, w_default):
         space = self.space
diff --git a/pypy/objspace/std/setobject.py b/pypy/objspace/std/setobject.py
--- a/pypy/objspace/std/setobject.py
+++ b/pypy/objspace/std/setobject.py
@@ -32,22 +32,6 @@
         reprlist = [repr(w_item) for w_item in w_self.setdata.keys()]
         return "<%s(%s)>" % (w_self.__class__.__name__, ', '.join(reprlist))
 
-    def _newobj(w_self, space, rdict_w=None):
-        """Make a new set or frozenset by taking ownership of 'rdict_w'."""
-        #return space.call(space.type(w_self),W_SetIterObject(rdict_w))
-        objtype = type(w_self)
-        if objtype is W_SetObject:
-            w_obj = W_SetObject(space, rdict_w)
-        elif objtype is W_FrozensetObject:
-            w_obj = W_FrozensetObject(space, rdict_w)
-        else:
-            w_type = space.type(w_self)
-            _, w_newdescr = w_type.lookup_where('__new__')
-            w_newfunc = space.get(w_newdescr, w_type)
-            w_itemiterator = W_SetIterObject(rdict_w)
-            w_obj = space.call_function(w_newfunc, w_type, w_itemiterator)
-        return w_obj
-
     _lifeline_ = None
     def getweakref(self):
         return self._lifeline_
@@ -57,10 +41,28 @@
 class W_SetObject(W_BaseSetObject):
     from pypy.objspace.std.settype import set_typedef as typedef
 
+    def _newobj(w_self, space, rdict_w):
+        """Make a new set by taking ownership of 'rdict_w'."""
+        if type(w_self) is W_SetObject:
+            return W_SetObject(space, rdict_w)
+        w_type = space.type(w_self)
+        w_obj = space.allocate_instance(W_SetObject, w_type)
+        W_SetObject.__init__(w_obj, space, rdict_w)
+        return w_obj
+
 class W_FrozensetObject(W_BaseSetObject):
     from pypy.objspace.std.frozensettype import frozenset_typedef as typedef
     hash = 0
 
+    def _newobj(w_self, space, rdict_w):
+        """Make a new frozenset by taking ownership of 'rdict_w'."""
+        if type(w_self) is W_FrozensetObject:
+            return W_FrozensetObject(space, rdict_w)
+        w_type = space.type(w_self)
+        w_obj = space.allocate_instance(W_FrozensetObject, w_type)
+        W_FrozensetObject.__init__(w_obj, space, rdict_w)
+        return w_obj
+
 registerimplementation(W_BaseSetObject)
 registerimplementation(W_SetObject)
 registerimplementation(W_FrozensetObject)
diff --git a/pypy/objspace/std/test/test_setobject.py b/pypy/objspace/std/test/test_setobject.py
--- a/pypy/objspace/std/test/test_setobject.py
+++ b/pypy/objspace/std/test/test_setobject.py
@@ -57,6 +57,32 @@
         b = a | set('abc')
         assert type(b) is subset
 
+    def test_init_new_behavior(self):
+        s = set.__new__(set, 'abc')
+        assert s == set()                # empty
+        s.__init__('def')
+        assert s == set('def')
+        #
+        s = frozenset.__new__(frozenset, 'abc')
+        assert s == frozenset('abc')     # non-empty
+        s.__init__('def')
+        assert s == frozenset('abc')     # the __init__ is ignored
+
+    def test_subtype_bug(self):
+        class subset(set): pass
+        b = subset('abc')
+        subset.__new__ = lambda *args: foobar   # not called
+        b = b.copy()
+        assert type(b) is subset
+        assert set(b) == set('abc')
+        #
+        class frozensubset(frozenset): pass
+        b = frozensubset('abc')
+        frozensubset.__new__ = lambda *args: foobar   # not called
+        b = b.copy()
+        assert type(b) is frozensubset
+        assert frozenset(b) == frozenset('abc')
+
     def test_union(self):
         a = set([4, 5])
         b = a.union([5, 7])
@@ -131,11 +157,6 @@
         assert s1 is not s2
         assert s1 == s2
         assert type(s2) is myfrozen
-        class myfrozen(frozenset):
-            def __new__(cls):
-                return frozenset.__new__(cls, 'abc')
-        s1 = myfrozen()
-        raises(TypeError, s1.copy)
 
     def test_update(self):
         s1 = set('abc')


More information about the pypy-commit mailing list