[issue36787] Python3 regresison: String formatting of None object

2019-05-03 Thread Eric V. Smith
Eric V. Smith added the comment: This behavior isn't going to change. As Zach says, if you want to convert any value to a string, use !s. We want to fail as soon as possible: if a class (such as NoneType) doesn't implement __format__, then trying to format an instance with a format spec that

[issue36787] Python3 regresison: String formatting of None object

2019-05-03 Thread Zachary Ware
Zachary Ware added the comment: You can use `!s` to be sure that the object is a string: >>> '{!s:^10}'.format(None) ' None ' I think it's unlikely the behavior of NoneType.__format__ will be changed, but I'm adding Eric Smith to make that determination as the maintainer of str.format.

[issue36787] Python3 regresison: String formatting of None object

2019-05-03 Thread Gawain Bolton
Gawain Bolton added the comment: Note: I have a patch which fixes this. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue36787] Python3 regresison: String formatting of None object

2019-05-03 Thread Gawain Bolton
New submission from Gawain Bolton : 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