This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Gawain Bolton
Recipients Gawain Bolton
Date 2019-05-03.20:30:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1556915435.58.0.661540149736.issue36787@roundup.psfhosted.org>
In-reply-to
Content
Python 2.7.16 (default, Apr  6 2019, 01:42:57)
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.                                                                
>>> print('{:^10}'.format(None))
   None

However this does not work with Python3:
Python 3.7.3 (default, Apr  3 2019, 05:39:12)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.                                                                
>>> print('{:^10}'.format(None))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported format string passed to NoneType.__format__

Given that the None type is output as a string, it makes sense for                                                           string formatting options to be usable with it.  It also makes code                                                              less fragile and avoids having to write special cases for when values                                                             
could be None.
History
Date User Action Args
2019-05-03 20:30:35Gawain Boltonsetrecipients: + Gawain Bolton
2019-05-03 20:30:35Gawain Boltonsetmessageid: <1556915435.58.0.661540149736.issue36787@roundup.psfhosted.org>
2019-05-03 20:30:35Gawain Boltonlinkissue36787 messages
2019-05-03 20:30:35Gawain Boltoncreate