Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!gegeweb.42!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed5.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; 'subject:code': 0.07; 'python': 0.08; 'types:': 0.09; 'subject:python': 0.10; 'am,': 0.12; 'received:209.85.210.174': 0.13; 'received:mail- iy0-f174.google.com': 0.13; '1",': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'str()': 0.16; 'subject:analysis': 0.16; 'subject:questions': 0.16; 'wrote:': 0.18; '>>>': 0.18; 'jan': 0.19; 'header:In-Reply-To:1': 0.22; 'message-id:@mail.gmail.com': 0.28; 'error': 0.29; 'typeerror:': 0.30; 'chris': 0.30; 'version': 0.32; 'thu,': 0.32; 'there': 0.33; 'to:addr:python-list': 0.34; 'comparing': 0.37; 'variables': 0.37; 'received:google.com': 0.37; 'received:209.85': 0.38; 'received:209': 0.40; 'to:addr:python.org': 0.40; 'subject: / ': 0.63; '2012': 0.67; 'lucas': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=vPFNneMnNFKtZ4t/ZLChj2o9t8qbVUwukDwYOQ30c3Y=; b=E9c2p7S+in7r3LkzKHvRfCydXpCcqW4mRkYgerJ3bO2K11EBfS/Mao2IRCJ/6OFcAD EBFxd8V3FVtEHslZ8FEdHFFIK+mfSKlRfo5VVgQyQXQpglEcngwxgqXn5fuoug4TI5vv 6pzzw4gMmiRKhCB+/XKSgzu658/vPahsURRCM= MIME-Version: 1.0 In-Reply-To: References: Date: Thu, 5 Jan 2012 07:38:03 +1100 Subject: Re: Typed python comparison / code analysis questions From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 12 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1325709486 news.xs4all.nl 6986 [2001:888:2000:d::a6]:35317 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:18514 On Thu, Jan 5, 2012 at 7:09 AM, Lucas Vickers wrote: > 2) Is there a way to error when comparing variables of different types? Yep. Use Python version 3. >>> 1<"1" Traceback (most recent call last): File "", line 1, in 1<"1" TypeError: unorderable types: int() < str() Chris Angelico