Message341357
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. |
|
Date |
User |
Action |
Args |
2019-05-03 20:50:24 | zach.ware | set | recipients:
+ zach.ware, eric.smith, Gawain Bolton |
2019-05-03 20:50:24 | zach.ware | set | messageid: <1556916624.81.0.0971057919994.issue36787@roundup.psfhosted.org> |
2019-05-03 20:50:24 | zach.ware | link | issue36787 messages |
2019-05-03 20:50:24 | zach.ware | create | |
|