[Python-checkins] peps: Fix formatting.

antoine.pitrou python-checkins at python.org
Tue Jan 21 22:24:07 CET 2014


http://hg.python.org/peps/rev/761e18fca78e
changeset: 5354:761e18fca78e
user: Antoine Pitrou <solipsis at pitrou.net>
date: Tue Jan 21 22:24:03 2014 +0100
summary:
 Fix formatting.
files:
 pep-0461.txt | 27 +++++++++++++--------------
 1 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/pep-0461.txt b/pep-0461.txt
--- a/pep-0461.txt
+++ b/pep-0461.txt
@@ -59,15 +59,15 @@
 >>> b'%c' % b'a'
 b'a'
 
-``%s`` is restricted in what it will accept::
+``%s`` is restricted in what it will accept:
 
- - input type supports ``Py_buffer`` [4]_?
- use it to collect the necessary bytes
+- input type supports ``Py_buffer`` [4]_?
+ use it to collect the necessary bytes
 
- - input type is something else?
- use its ``__bytes__`` method [5]_ ; if there isn't one, raise a ``TypeError``
+- input type is something else?
+ use its ``__bytes__`` method [5]_ ; if there isn't one, raise a ``TypeError``
 
-Examples:
+Examples::
 
 >>> b'%s' % b'abc'
 b'abc'
@@ -83,7 +83,6 @@
 TypeError: 'hello world' has no __bytes__ method, perhaps you need to encode it?
 
 .. note::
-
 Because the ``str`` type does not have a ``__bytes__`` method, attempts to
 directly use ``'a string'`` as a bytes interpolation value will raise an
 exception. To use ``'string'`` values, they must be encoded or otherwise
@@ -116,21 +115,21 @@
 
 It has been suggested to use ``%b`` for bytes instead of ``%s``.
 
- - Rejected as ``%b`` does not exist in Python 2.x %-interpolation, which is
- why we are using ``%s``.
+- Rejected as ``%b`` does not exist in Python 2.x %-interpolation, which is
+ why we are using ``%s``.
 
 It has been proposed to automatically use ``.encode('ascii','strict')`` for
 ``str`` arguments to ``%s``.
 
- - Rejected as this would lead to intermittent failures. Better to have the
- operation always fail so the trouble-spot can be correctly fixed.
+- Rejected as this would lead to intermittent failures. Better to have the
+ operation always fail so the trouble-spot can be correctly fixed.
 
 It has been proposed to have ``%s`` return the ascii-encoded repr when the
 value is a ``str`` (b'%s' % 'abc' --> b"'abc'").
 
- - Rejected as this would lead to hard to debug failures far from the problem
- site. Better to have the operation always fail so the trouble-spot can be
- easily fixed.
+- Rejected as this would lead to hard to debug failures far from the problem
+ site. Better to have the operation always fail so the trouble-spot can be
+ easily fixed.
 
 Originally this PEP also proposed adding format style formatting, but it
 was decided that format and its related machinery were all strictly text
-- 
Repository URL: http://hg.python.org/peps


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /