Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #53124

Re: Why is str(None) == 'None' and not an empty string?

From Terry Reedy <tjreedy@udel.edu>
Subject Re: Why is str(None) == 'None' and not an empty string?
Date 2013-08-28 06:33 -0400
References <155b0796-147b-4132-adf0-e73c0e30969a@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.300.1377686649.19984.python-list@python.org> (permalink)

Show all headers | View raw


On 8/28/2013 4:57 AM, Piotr Dobrogost wrote:

> Having repr(None) == 'None' is sure the right thing but why does str(None) == 'None'? Wouldn't it be more correct if it was an empty string?

No.
There is no reason to be different.

-- 
Terry Jan Reedy

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Why is str(None) == 'None' and not an empty string? Piotr Dobrogost <p@google-groups-2013.dobrogost.net> - 2013-08-28 01:57 -0700
  Re: Why is str(None) == 'None' and not an empty string? Terry Reedy <tjreedy@udel.edu> - 2013-08-28 06:33 -0400
  Re: Why is str(None) == 'None' and not an empty string? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-28 12:21 +0000
    Re: Why is str(None) == 'None' and not an empty string? Ian Kelly <ian.g.kelly@gmail.com> - 2013-08-29 04:43 -0600
      Re: Why is str(None) == 'None' and not an empty string? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-30 01:57 +0000
        Re: Why is str(None) == 'None' and not an empty string? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-30 02:44 +0000
    Re: Why is str(None) == 'None' and not an empty string? Tim Delaney <timothy.c.delaney@gmail.com> - 2013-08-30 06:59 +1000

csiph-web