[EMAIL PROTECTED] wrote:
Was doing some string formatting, noticed the following:
x = None
"%s" % x
'None'
Is there a reason it maps to 'None'? I had expected ''.
Because %s just calls str on the arguments, and str(None) == 'None'.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/
Jorge Godoy wrote:
[EMAIL PROTECTED] writes:
Was doing some string formatting, noticed the following:
x = None
"%s" % x
'None'
Is there a reason it maps to 'None'? I had expected ''.
How would know, then, if there was no value at all or if it was an empty
string?
Well, for that matter, how can
Jorge Godoy wrote:
[EMAIL PROTECTED] writes:
Was doing some string formatting, noticed the following:
x = None
"%s" % x
'None'
Is there a reason it maps to 'None'? I had expected ''.
How would know, then, if there was no value at all or if it was an empty
string?
If you want the other effect, you
[EMAIL PROTECTED] writes:
> Was doing some string formatting, noticed the following:
>
> >>> x = None
> >>> "%s" % x
> 'None'
>
> Is there a reason it maps to 'None'? I had expected ''.
How would know, then, if there was no value at all or if it was an empty
string?
--
Godoy. <[EMAIL PR
[EMAIL PROTECTED] wrote:
Was doing some string formatting, noticed the following:
x = None
"%s" % x
'None'
Is there a reason it maps to 'None'? I had expected ''.
Can you explain why you expected that? A few other examples that make
me not expect what you do:
py> '%s' % False
'False'
py> '%s' %
Was doing some string formatting, noticed the following:
>>> x = None
>>> "%s" % x
'None'
Is there a reason it maps to 'None'? I had expected ''.
--
http://mail.python.org/mailman/listinfo/python-list