Eric V. Smith added the comment:

I think the best we could do is have None.__format__ be:

def __format__(self, fmt):
   return str(self).__format__(fmt)

Or its logical equivalent.

But this seems more like papering over a bug, instead of actually fixing a 
problem. My suggestion is to use:
"{!s}".format(None)
That is: if you want to format a string, then explicitly force the argument to 
be a string.

I don't think None should be special and be auto-converted to a string.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7994>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to