Re: None in string formatting

2005-03-08 Thread Erik Max Francis
[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/

Re: None in string formatting

2005-03-08 Thread Steve Holden
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

Re: None in string formatting

2005-03-08 Thread Scott David Daniels
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

Re: None in string formatting

2005-03-08 Thread Jorge Godoy
[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

Re: None in string formatting

2005-03-08 Thread Steven Bethard
[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' %

None in string formatting

2005-03-08 Thread rodney . maxwell
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