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


Groups > comp.lang.python > #53117

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

X-Received by 10.66.145.162 with SMTP id sv2mr7037526pab.15.1377680237265; Wed, 28 Aug 2013 01:57:17 -0700 (PDT)
X-Received by 10.49.12.162 with SMTP id z2mr20901qeb.14.1377680236981; Wed, 28 Aug 2013 01:57:16 -0700 (PDT)
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!pt2no36566885pbb.0!news-out.google.com!rn2ni51873pbc.1!nntp.google.com!fx3no5858914qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.python
Date Wed, 28 Aug 2013 01:57:16 -0700 (PDT)
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=195.117.20.143; posting-account=RvHFJQoAAABjGPM8XlLh6XgKam0WFBaf
NNTP-Posting-Host 195.117.20.143
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <155b0796-147b-4132-adf0-e73c0e30969a@googlegroups.com> (permalink)
Subject Why is str(None) == 'None' and not an empty string?
From Piotr Dobrogost <p@google-groups-2013.dobrogost.net>
Injection-Date Wed, 28 Aug 2013 08:57:17 +0000
Content-Type text/plain; charset=ISO-8859-1
Xref csiph.com comp.lang.python:53117

Show key headers only | View raw


Hi!

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?

Regards
Piotr Dobrogost

Back to comp.lang.python | Previous | NextNext 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