Author: Richard Plangger <[email protected]>
Branch:
Changeset: r90398:14bcde218123
Date: 2017-02-27 14:57 +0100
http://bitbucket.org/pypy/pypy/changeset/14bcde218123/
Log: (mjacob, plan_rich) update bytes_w to autodoc
diff --git a/pypy/doc/objspace.rst b/pypy/doc/objspace.rst
--- a/pypy/doc/objspace.rst
+++ b/pypy/doc/objspace.rst
@@ -291,13 +291,9 @@
If :py:obj:`w_x` is an application-level integer or long, return an
interpreter-level
:py:class:`rbigint`. Otherwise raise :py:exc:`TypeError`.
+.. automethod:: pypy.interpreter.baseobjspace.ObjSpace.bytes_w(w_x)
.. automethod:: pypy.interpreter.baseobjspace.ObjSpace.text_w(w_x)
-.. py:function:: bytes_w(w_x)
-
- Takes an application level :py:class:`bytes` (PyPy2 this equals `str`) and
returns a rpython
- byte string.
-
.. py:function:: str_w(w_x)
**Deprecated. use text_w or bytes_w instead**
diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py
--- a/pypy/interpreter/baseobjspace.py
+++ b/pypy/interpreter/baseobjspace.py
@@ -1609,7 +1609,9 @@
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."
+ """ Takes an application level :py:class:`bytes`
+ (on PyPy2 this equals `str`) and returns a rpython byte string.
+ """
return w_obj.str_w(self)
def text_w(self, w_obj):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit