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: 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; '>>>': 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 To: Roy Smith Content-Type: multipart/alternative; boundary=047d7b5d2e20d5041104fb690d1b Cc: "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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 --047d7b5d2e20d5041104fb690d1b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, Jun 9, 2014 at 10:34 AM, Roy Smith wrote: > We noticed recently that: > > >>> None in 'foo' > > raises (at least in Python 2.7) > > TypeError: 'in ' 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 =E2=80=8B. I don't know the story or implementation behind it, so I'll leav= e that to others.=E2=80=8B --047d7b5d2e20d5041104fb690d1b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Mon, Jun 9, 2014 a= t 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
=E2=80=8B. I don't know the story or implementation behind it, so I'= ;ll leave that to others.=E2=80=8B
=C2=A0

=
--047d7b5d2e20d5041104fb690d1b--