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


Groups > comp.lang.python > #73040

Re: None in string => TypeError?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <ryan@ryanhiebert.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; '(at': 0.04; 'string': 0.09; 'raises': 0.09; 'subject:None': 0.09; 'subject:string': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'from:addr:ryan': 0.16; 'roy': 0.16; 'typeerror:': 0.16; 'received:74.125.82.44': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'cc:addr:python.org': 0.22; '&gt;&gt;&gt;': 0.24; 'mon,': 0.24; 'cc:2**0': 0.24; 'least': 0.26; 'header:In-Reply-To:1': 0.27; 'leave': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'noticed': 0.34; 'received:74.125.82': 0.34; 'agree': 0.35; 'received:google.com': 0.35; "i'll": 0.36; 'subject:?': 0.36; 'behind': 0.37; 'skip:& 10': 0.38; 'received:74.125': 0.39; 'story': 0.63; 'smith': 0.68; "'foo'": 0.84
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=vcddABGmx0sY1/J2klnoAFm+a6sO3tjjI4LqRoxyUPo=; b=eiLh4r+4bXtAPhjj0wUzmYQRpqdvSmo6SQE0kbKe3x04V9WQO8oAvXT9wx9Ca+tYZ+ NJfMIPrvMhfB9lMG31oSmMf2wvbGB98CtVxzKqk12kEuHWWWRCjA6e9JtJGJKs7PSRzM FfwA3QI4ofLuLLErDsBRVzwJLJQKtG1t4/INXeZWUlF8ey+CCl3ZzZqGrJd20EgVl/C/ 7I6BbbPWYY40q/qPcMjBzj2M+a6QX5UKBTMtTO4QkZb2w83dBT0gniu8ckJBqfp5wqTy QPmYWvrV4AaTkvYolNd+fcGD2sqzwGa76mkViENd3yq0D8I894sHGrS21FWkp2PIu3bf /YAw==
X-Gm-Message-State ALoCoQkiCiTwactdWobStgj/ivsYevVESftFLl8ReHsoP3SAniqMTgVJ8Giyl+GRhgy3PYxkphl+
MIME-Version 1.0
X-Received by 10.194.6.2 with SMTP id w2mr32343608wjw.6.1402328529038; Mon, 09 Jun 2014 08:42:09 -0700 (PDT)
X-Originating-IP [98.172.7.178]
In-Reply-To <048960da-c132-407f-b1b3-4612a3dd7697@googlegroups.com>
References <048960da-c132-407f-b1b3-4612a3dd7697@googlegroups.com>
Date Mon, 9 Jun 2014 10:42:08 -0500
Subject Re: None in string => TypeError?
From Ryan Hiebert <ryan@ryanhiebert.com>
To Roy Smith <roy@panix.com>
Content-Type multipart/alternative; boundary=047d7b5d2e20d5041104fb690d1b
Cc "python-list@python.org" <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.10920.1402328536.18130.python-list@python.org> (permalink)
Lines 52
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1402328536 news.xs4all.nl 2946 [2001:888:2000:d::a6]:35048
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:73040

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On Mon, Jun 9, 2014 at 10:34 AM, Roy Smith <roy@panix.com> wrote:

> We noticed recently that:
>
> >>> None in 'foo'
>
> raises (at least in Python 2.7)
>
> TypeError: 'in <string>' requires string as left operand, not NoneType
>
> This is surprising.
>
> It's the same in 3.4, and I agree that it's surprising, at least to me
​. I don't know the story or implementation behind it, so I'll leave that
to others.​

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


Thread

None in string => TypeError? Roy Smith <roy@panix.com> - 2014-06-09 08:34 -0700
  Re: None in string => TypeError? Ryan Hiebert <ryan@ryanhiebert.com> - 2014-06-09 10:42 -0500
  Re: None in string => TypeError? Ian Kelly <ian.g.kelly@gmail.com> - 2014-06-09 09:50 -0600
  Re: None in string => TypeError? Paul Sokolovsky <pmiscml@gmail.com> - 2014-06-09 18:57 +0300
    Re: None in string => TypeError? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-06-09 16:14 +0000
      Re: None in string => TypeError? Chris Angelico <rosuav@gmail.com> - 2014-06-10 02:31 +1000
  Re: None in string => TypeError? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-06-09 16:07 +0000
  Re: None in string => TypeError? MRAB <python@mrabarnett.plus.com> - 2014-06-09 17:06 +0100
  Re: None in string => TypeError? Shiyao Ma <i@introo.me> - 2014-06-10 00:13 +0800
  Re: None in string => TypeError? Roy Smith <roy@panix.com> - 2014-06-09 12:53 -0400
  Re: None in string => TypeError? Chris Angelico <rosuav@gmail.com> - 2014-06-10 02:59 +1000
  Re: None in string => TypeError? Ian Kelly <ian.g.kelly@gmail.com> - 2014-06-09 11:22 -0600
  Re: None in string => TypeError? Chris Angelico <rosuav@gmail.com> - 2014-06-10 03:40 +1000
  Re: None in string => TypeError? Ian Kelly <ian.g.kelly@gmail.com> - 2014-06-09 11:58 -0600
  Re: None in string => TypeError? Chris Angelico <rosuav@gmail.com> - 2014-06-10 04:02 +1000

csiph-web