str(None) == '' ?

Eduard Hiti eduard.hiti at t-online.de
Thu Jun 1 10:23:11 EDT 2000


I would like to suggest that

    str(None)

should NOT return the string 'None', since most of the time, it complicates
things.

Then code like

    value = str(get_stuff())
    if value:
        # Do something to value

would not stumble over the occasional None.

At least one of the string converting functions repr|str should return a
empty string on None.

Is there a reason for str(None) == 'None' that I'm missing?






More information about the Python-list mailing list