Zachary Ware <[email protected]> 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.
See issue7994 for the background on the change that produced this behavior.
----------
nosy: +eric.smith, zach.ware
versions: +Python 3.8
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue36787>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com