From 12ec96eeb039dbc78c339ea9382d103ae8965b6b Mon Sep 17 00:00:00 2001 From: gotlibsh Date: Fri, 3 Apr 2020 17:22:17 +0300 Subject: [PATCH] Add note in docs regarding uppercase 'X' specifier I noticed that when using string format to print hexadecimal numbers like the following: >>> '{:#X}'.format(1234) '0X4D2' I get an uppercase 'X', this is worth mentioning in the docs. --- Doc/library/string.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Doc/library/string.rst b/Doc/library/string.rst index fa906f799c1082..542a63b7402776 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -463,6 +463,8 @@ The available integer presentation types are: +---------+----------------------------------------------------------+ | ``'X'`` | Hex format. Outputs the number in base 16, using | | | upper-case letters for the digits above 9. | + | | Note: In case # is specified, the prefix '0x' will be | + | | uppercased as well. | +---------+----------------------------------------------------------+ | ``'n'`` | Number. This is the same as ``'d'``, except that it uses | | | the current locale setting to insert the appropriate |