Author: Ronan Lamy <ronan.l...@gmail.com>
Branch: py3.5
Changeset: r90442:7e102a870512
Date: 2017-03-01 16:09 +0100
http://bitbucket.org/pypy/pypy/changeset/7e102a870512/

Log:    hg merge default

diff --git a/pypy/doc/cpython_differences.rst b/pypy/doc/cpython_differences.rst
--- a/pypy/doc/cpython_differences.rst
+++ b/pypy/doc/cpython_differences.rst
@@ -496,6 +496,11 @@
   the rest is kept.  If you return an unexpected string from
   ``__hex__()`` you get an exception (or a crash before CPython 2.7.13).
 
+* PyPy3: ``__class__`` attritube assignment between heaptypes and non 
heaptypes.
+  CPython allows that for module subtypes, but not for e.g. ``int``
+  or ``float`` subtypes. Currently PyPy does not support the
+  ``__class__`` attribute assignment for any non heaptype subtype.
+
 .. _`is ignored in PyPy`: http://bugs.python.org/issue14621
 .. _`little point`: 
http://events.ccc.de/congress/2012/Fahrplan/events/5152.en.html
 .. _`#2072`: https://bitbucket.org/pypy/pypy/issue/2072/
diff --git a/pypy/doc/project-ideas.rst b/pypy/doc/project-ideas.rst
--- a/pypy/doc/project-ideas.rst
+++ b/pypy/doc/project-ideas.rst
@@ -1,9 +1,24 @@
-Potential project list
+Potential Project List
 ======================
 
-==========================
+Google Summer of Code 2017
+--------------------------
+
+PyPy is generally open to new ideas for Google Summer of Code. We are happy to 
accept good ideas around the PyPy ecosystem. If you need more information about 
the ideas we propose for this year please join us on irc, channel #pypy 
(freenode). If you are unsure, but still think that you can make a valuable 
contribution to PyPy, dont hesitate to contact us on #pypy or on our mailing 
list.
+
+
+* **Optimize PyPy Memory Usage**: PyPy currently emits a small executable file 
and a large shared object file. To reduce the base interpreter size we think it 
would be helpful to have several shared object files that can be dynamically 
loaded if the module is needed. There are several other potential places where 
we could improve.
+
+* **VMProf + memory profiler**: vmprof by now has a memory profiler that can 
be used already. We want extend it with more features and resolve some current 
limitations.
+
+* **VMProf visualisations**: vmprof just shows a flamgraph of the statistical 
profile and some more information about specific call sites. It would be very 
interesting to experiment with different information (such as memory, or even 
information generated by our jit compiler).
+
+* **Explicit typing in RPython**: PyPy wants to have better ways to specify 
the signature and class attribute types in RPython. See more information about 
this topic below on this page.
+
+* **Virtual Reality (VR) visualisations for vmprof**: This is a very open 
topic with lots of freedom to explore data visualisation for profiles. No VR 
hardware would be needed for this project. Either universities provide such 
hardware or in any other case we potentially can lend the VR hardware setup.
+
 Simple tasks for newcomers
-==========================
+--------------------------
 
 * Tkinter module missing support for threads:
   
https://bitbucket.org/pypy/pypy/issue/1929/tkinter-broken-for-threaded-python-on-both
@@ -15,9 +30,8 @@
   https://bitbucket.org/pypy/pypy/issue/1942/support-for-af_xxx-sockets
 
 
-==================
 Mid-to-large tasks
-==================
+------------------
 
 Below is a list of projects that are interesting for potential contributors
 who are seriously interested in the PyPy project. They mostly share common
@@ -81,7 +95,7 @@
 module.
 
 Improving the jitviewer
-------------------------
+-----------------------
 
 Analyzing performance of applications is always tricky. We have various
 tools, for example a `jitviewer`_ that help us analyze performance.
diff --git a/pypy/goal/getnightly.py b/pypy/goal/getnightly.py
--- a/pypy/goal/getnightly.py
+++ b/pypy/goal/getnightly.py
@@ -4,16 +4,24 @@
 import os
 import py
 
+TAR_OPTIONS = '-x -v --strip-components=2'
+TAR = 'tar {options} -f {tarfile} {files}'
+
+def untar(tarfile, files):
+    cmd = TAR.format(options=TAR_OPTIONS, tarfile=tarfile, files=files)
+    os.system(cmd)
+
 if sys.platform.startswith('linux'):
     arch = 'linux'
     cmd = 'wget "%s"'
-    tar = "tar -x -v --wildcards --strip-components=2 -f %s '*/bin/pypy' 
'*/bin/libpypy-c.so'"
+    TAR_OPTIONS += ' --wildcards'
+    binfiles = "'*/bin/pypy' '*/bin/libpypy-c.so'"
     if os.uname()[-1].startswith('arm'):
         arch += '-armhf-raspbian'
 elif sys.platform.startswith('darwin'):
     arch = 'osx'
     cmd = 'curl -O "%s"'
-    tar = "tar -x -v --strip-components=2 -f %s '*/bin/pypy'"
+    binfiles = "'*/bin/pypy'"
 else:
     print 'Cannot determine the platform, please update this script'
     sys.exit(1)
@@ -34,6 +42,7 @@
 filename = 'pypy-c-%s-latest-%s.tar.bz2' % (kind, arch)
 url = 'http://buildbot.pypy.org/nightly/%s/%s' % (branch, filename)
 tmp = py.path.local.mkdtemp()
+pypy_latest = tmp.join(filename)
 mydir = tmp.chdir()
 print 'Downloading pypy to', tmp
 if os.system(cmd % url) != 0:
@@ -41,4 +50,10 @@
 
 print 'Extracting pypy binary'
 mydir.chdir()
-os.system(tar % tmp.join(filename))
+untar(pypy_latest, binfiles)
+include_dir = py.path.local('../../include')
+if include_dir.check(dir=True):
+    include_dir.chdir()
+    untar(pypy_latest, '*/include/*')
+else:
+    print 'WARNING: could not find the include/ dir'
diff --git a/pypy/interpreter/astcompiler/misc.py 
b/pypy/interpreter/astcompiler/misc.py
--- a/pypy/interpreter/astcompiler/misc.py
+++ b/pypy/interpreter/astcompiler/misc.py
@@ -9,7 +9,7 @@
     try:
         warnings.warn_explicit(msg, SyntaxWarning, fn, lineno)
     except SyntaxWarning:
-        raise SyntaxError(msg, fn, lineno, offset)
+        raise SyntaxError(msg, (fn, lineno, offset, msg))
 """, filename=__file__)
 _emit_syntax_warning = app.interphook("syntax_warning")
 del app
diff --git a/pypy/interpreter/astcompiler/test/test_misc.py 
b/pypy/interpreter/astcompiler/test/test_misc.py
--- a/pypy/interpreter/astcompiler/test/test_misc.py
+++ b/pypy/interpreter/astcompiler/test/test_misc.py
@@ -12,3 +12,23 @@
     assert mangle("__foo", "__Bar") == "_Bar__foo"
     assert mangle("__foo", "___") == "__foo"
     assert mangle("___foo", "__Bar") == "_Bar___foo"
+
+def app_test_warning_to_error_translation():
+    import warnings
+    
+    with warnings.catch_warnings():
+        warnings.filterwarnings("error", module="<test string>")
+        statement = """\
+def wrong1():
+    a = 1
+    b = 2
+    global a
+    global b
+"""
+        try:
+           compile(statement, '<test string>', 'exec')
+        except SyntaxError as err:
+           assert err.lineno is not None
+           assert err.filename is not None
+           assert err.offset is not None
+           assert err.message is not None
diff --git a/rpython/jit/metainterp/test/test_ajit.py 
b/rpython/jit/metainterp/test/test_ajit.py
--- a/rpython/jit/metainterp/test/test_ajit.py
+++ b/rpython/jit/metainterp/test/test_ajit.py
@@ -4636,3 +4636,28 @@
             return i
 
         self.meta_interp(f, [10])
+
+    @py.test.skip("loops!")
+    def test_finalizer_bug(self):
+        from rpython.rlib import rgc
+        driver = JitDriver(greens=[], reds=[])
+        class Fin(object):
+            @rgc.must_be_light_finalizer
+            def __del__(self):
+                holder[0].field = 7
+        class Un(object):
+            def __init__(self):
+                self.field = 0
+        holder = [Un()]
+
+        def f():
+            while True:
+                driver.jit_merge_point()
+                holder[0].field = 0
+                Fin()
+                if holder[0].field:
+                    break
+            return holder[0].field
+
+        f() # finishes
+        self.meta_interp(f, [])
diff --git a/rpython/memory/gc/incminimark.py b/rpython/memory/gc/incminimark.py
--- a/rpython/memory/gc/incminimark.py
+++ b/rpython/memory/gc/incminimark.py
@@ -1138,7 +1138,7 @@
         # Check if the object at 'addr' is young.
         if not self.is_valid_gc_object(addr):
             return False     # filter out tagged pointers explicitly.
-        if self.nursery <= addr < self.nursery_top:
+        if self.is_in_nursery(addr):
             return True      # addr is in the nursery
         # Else, it may be in the set 'young_rawmalloced_objects'
         return (bool(self.young_rawmalloced_objects) and
diff --git a/rpython/rtyper/rmodel.py b/rpython/rtyper/rmodel.py
--- a/rpython/rtyper/rmodel.py
+++ b/rpython/rtyper/rmodel.py
@@ -359,6 +359,10 @@
     def ll_str(self, nothing): raise AssertionError("unreachable code")
 impossible_repr = VoidRepr()
 
+class __extend__(pairtype(Repr, VoidRepr)):
+    def convert_from_to((r_from, r_to), v, llops):
+        return inputconst(lltype.Void, None)
+
 class SimplePointerRepr(Repr):
     "Convenience Repr for simple ll pointer types with no operation on them."
 
diff --git a/rpython/rtyper/test/test_rpbc.py b/rpython/rtyper/test/test_rpbc.py
--- a/rpython/rtyper/test/test_rpbc.py
+++ b/rpython/rtyper/test/test_rpbc.py
@@ -1746,6 +1746,29 @@
         res = self.interpret(g, [1])
         assert res == True
 
+    def test_convert_from_anything_to_impossible(self):
+        def f1():
+            return 42
+        def f2():
+            raise ValueError
+        def f3():
+            raise ValueError
+        def f(i):
+            if i > 5:
+                f = f2
+            else:
+                f = f3
+            try:
+                f()
+            except ValueError:
+                pass
+            if i > 1:
+                f = f2
+            else:
+                f = f1
+            return f()
+        self.interpret(f, [-5])
+
 # ____________________________________________________________
 
 def test_hlinvoke_simple():
diff --git a/rpython/translator/c/test/test_standalone.py 
b/rpython/translator/c/test/test_standalone.py
--- a/rpython/translator/c/test/test_standalone.py
+++ b/rpython/translator/c/test/test_standalone.py
@@ -1123,7 +1123,7 @@
 
     def compile(self, entry_point, no__thread=True):
         t = TranslationContext(self.config)
-        t.config.translation.gc = "semispace"
+        t.config.translation.gc = "incminimark"
         t.config.translation.gcrootfinder = self.gcrootfinder
         t.config.translation.thread = True
         t.config.translation.no__thread = no__thread
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to