[pypy-commit] pypy py3.5: (plan_rich, mjacob) hg merge default
mjacob
pypy.commits at gmail.com
Mon Feb 27 08:34:13 EST 2017
Author: Manuel Jacob <me at manueljacob.de>
Branch: py3.5
Changeset: r90393:2e9fdb0ad351
Date: 2017-02-27 14:34 +0100
http://bitbucket.org/pypy/pypy/changeset/2e9fdb0ad351/
Log: (plan_rich, mjacob) hg merge default
diff --git a/.hgignore b/.hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -60,6 +60,9 @@
^lib_pypy/ctypes_config_cache/_.+_cache\.py$
^lib_pypy/ctypes_config_cache/_.+_.+_\.py$
^lib_pypy/_libmpdec/.+.o$
+^lib_pypy/.+.c$
+^lib_pypy/.+.o$
+^lib_pypy/.+.so$
^pypy/doc/discussion/.+\.html$
^include/.+\.h$
^include/.+\.inl$
diff --git a/pypy/doc/build.rst b/pypy/doc/build.rst
--- a/pypy/doc/build.rst
+++ b/pypy/doc/build.rst
@@ -49,7 +49,7 @@
-------------------------------
(**Note**: for some hints on how to translate the Python interpreter under
Windows, see the `windows document`_ . For hints on how to cross-compile in
-a chroot using scratchbox2, see the `arm document`_ in the
+a chroot using scratchbox2, see the `arm document`_ in the
`RPython documentation`_)
.. _`windows document`: windows.html
@@ -57,7 +57,7 @@
.. _`RPython documentation`: http://rpython.readthedocs.org
The host Python needs to have CFFI installed. If translating on PyPy, CFFI is
-already installed. If translating on CPython, you need to install it, e.g.
+already installed. If translating on CPython, you need to install it, e.g.
using ``pip install cffi``.
To build PyPy on Unix using the C translation backend, you need at least a C
@@ -113,7 +113,7 @@
On Fedora::
dnf install gcc make libffi-devel pkgconfig zlib-devel bzip2-devel \
- lib-sqlite3-devel ncurses-devel expat-devel openssl-devel tk-devel \
+ sqlite-devel ncurses-devel expat-devel openssl-devel tk-devel \
gdbm-devel \
xz-devel # For lzma on PyPy3.
@@ -183,7 +183,7 @@
imported the first time.
::
-
+
cd pypy/tool/release
./package.py pypy-VER-PLATFORM
@@ -220,5 +220,3 @@
to continue normally. If the default path is usable, most code will be fine.
However, the ``sys.prefix`` will be unset and some existing libraries assume
that this is never the case.
-
-
diff --git a/pypy/doc/conf.py b/pypy/doc/conf.py
--- a/pypy/doc/conf.py
+++ b/pypy/doc/conf.py
@@ -17,6 +17,7 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.append(os.path.abspath('.'))
+sys.path.append(os.path.abspath('../../'))
# -- Read The Docs theme config ------------------------------------------------
diff --git a/pypy/doc/faq.rst b/pypy/doc/faq.rst
--- a/pypy/doc/faq.rst
+++ b/pypy/doc/faq.rst
@@ -437,3 +437,11 @@
but so far there doesn't seem to be an overwhelming commercial interest in it.
.. _`to make it happen`: windows.html#what-is-missing-for-a-full-64-bit-translation
+
+
+How long will PyPy support Python2?
+-----------------------------------
+
+Since RPython is built on top of Python2 and that is extremely unlikely to
+change, the Python2 version of PyPy will be around "forever", i.e. as long as
+PyPy itself is around.
diff --git a/pypy/doc/objspace.rst b/pypy/doc/objspace.rst
--- a/pypy/doc/objspace.rst
+++ b/pypy/doc/objspace.rst
@@ -291,10 +291,7 @@
If :py:obj:`w_x` is an application-level integer or long, return an interpreter-level
:py:class:`rbigint`. Otherwise raise :py:exc:`TypeError`.
-.. py:function:: text_w(w_x)
-
- Takes an application level :py:class:`str` and converts it to a rpython byte string.
- PyPy3 this method will return an utf-8-nosg encoded result.
+.. automethod:: pypy.interpreter.baseobjspace.ObjSpace.text_w(w_x)
.. py:function:: bytes_w(w_x)
diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py
--- a/pypy/interpreter/baseobjspace.py
+++ b/pypy/interpreter/baseobjspace.py
@@ -1580,6 +1580,21 @@
def text_or_none_w(self, w_obj):
return None if self.is_none(w_obj) else self.text_w(w_obj)
+ def bytes_w(self, w_obj):
+ "Takes a bytes object and returns an unwrapped RPython bytestring."
+ return w_obj.bytes_w(self)
+
+ def text_w(self, w_obj):
+ """ PyPy2 takes either a :py:class:`str` and returns a
+ rpython byte string, or it takes an :py:class:`unicode`
+ and uses the systems default encoding to return a rpython
+ byte string.
+
+ On PyPy3 it takes a :py:class:`str` and it will return
+ an utf-8 encoded rpython string.
+ """
+ return w_obj.text_w(self)
+
@not_rpython # tests only; should be replaced with bytes_w or text_w
def str_w(self, w_obj):
"""
@@ -1594,9 +1609,6 @@
else:
return w_obj.bytes_w(self)
- def bytes_w(self, w_obj):
- return w_obj.bytes_w(self)
-
def bytes0_w(self, w_obj):
"Like bytes_w, but rejects strings with NUL bytes."
from rpython.rlib import rstring
@@ -1665,14 +1677,6 @@
"characters")
return rstring.assert_str0(result)
- def text_w(self, w_obj):
- """
- Unwrap a unicode object and return a 'utf-8-nosg' byte string
- ('no surrogate'). This encoding always works and is in one-to-
- one correspondance with the unicode.
- """
- return w_obj.text_w(self)
-
realtext_w = text_w # Python 2 compatibility
realunicode_w = unicode_w
More information about the pypy-commit
mailing list