+------------+-----------------------------------------------------+-------+
| ``'o'`` | Signed octal value. | \(1) |
+------------+-----------------------------------------------------+-------+
-| ``'u'`` | Obsolete type -- it is identical to ``'d'``. | \(7) |
+| ``'u'`` | Obsolete type -- it is identical to ``'d'``. | \(8) |
+------------+-----------------------------------------------------+-------+
| ``'x'`` | Signed hexadecimal (lowercase). | \(2) |
+------------+-----------------------------------------------------+-------+
| ``'a'`` | Bytes (converts any Python object using | \(5) |
| | ``repr(obj).encode('ascii','backslashreplace)``). | |
+------------+-----------------------------------------------------+-------+
+| ``'r'`` | ``'r'`` is an alias for ``'a'`` and should only | \(7) |
+| | be used for Python2/3 code bases. | |
++------------+-----------------------------------------------------+-------+
| ``'%'`` | No argument is converted, results in a ``'%'`` | |
| | character in the result. | |
+------------+-----------------------------------------------------+-------+
``b'%s'`` is deprecated, but will not be removed during the 3.x series.
(7)
+ ``b'%r'`` is deprecated, but will not be removed during the 3.x series.
+
+(8)
See :pep:`237`.
.. note::
testcommon(b"%a", b"ghi", b"b'ghi'")
testcommon(b"%a", "jkl", b"'jkl'")
testcommon(b"%a", "\u0544", b"'\\u0544'")
+ # %r is an alias for %a
+ testcommon(b"%r", 3.14, b"3.14")
+ testcommon(b"%r", b"ghi", b"b'ghi'")
+ testcommon(b"%r", "jkl", b"'jkl'")
+ testcommon(b"%r", "\u0544", b"'\\u0544'")
# Test exception for unknown format characters, etc.
if verbose: