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


Groups > comp.lang.python > #57098

Re: Error Testing

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.041
X-Spam-Evidence '*H*': 0.92; '*S*': 0.00; 'correct.': 0.07; 'subject:Error': 0.07; 'converted': 0.09; 'negative.': 0.09; 'python': 0.11; "'input'": 0.16; 'evaluates': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'roy': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'value.': 0.19; 'entered': 0.20; 'integer': 0.24; 'string,': 0.24; 'first,': 0.26; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'evaluation': 0.30; 'statement': 0.30; 'strongly': 0.30; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; "i'd": 0.34; 'one,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'to:addr :python-list': 0.38; 'pm,': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; "you're": 0.61; 'name': 0.63; 'smith': 0.68; 'stated': 0.69; 'goal': 0.75; 'article': 0.77; 'glad': 0.83; 'batchelder': 0.84; 'subject:Testing': 0.84; 'scott': 0.93; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Alby7Gi89ZuD5P4pqIqhISa/x9BzWYCGj/u4PGM3MMI=; b=iu8E6+HtxGksXoN5lWg5vOxQP08pIzIJ9nyjsVx821zPULooWDdWJLmZ72lHBIa2QM LE+mYoTuc/nw2KdZWRz+QQuSWvsYSkEHJ/MLgw5xzfbHUxObeLZfdWeYHwnkpw5J+J8q CK9BUgCMCAg0G+dzixdU0+4uD2GelJKpwHsoyMJQM31TkcyUUL71wTay1SuzrhO2LkKd PKQZUZumadiCi0By0BtG8iMTWMaS0NrQQa6cZ+oL71UGlJX59IwUVfq1JNWK53FEGKFj YsdNUG5phCFu+KM5vebjY7KZ9l+yR2omz7+k/GBMxPlbpAjipFvFZ6WJt5WzTKhiRt8j kcXg==
MIME-Version 1.0
X-Received by 10.68.101.3 with SMTP id fc3mr8050762pbb.107.1382187853997; Sat, 19 Oct 2013 06:04:13 -0700 (PDT)
In-Reply-To <roy-1C4E8F.08571219102013@news.panix.com>
References <33549834-2f27-47f3-abea-eb3486909dec@googlegroups.com> <mailman.1254.1382186691.18130.python-list@python.org> <roy-1C4E8F.08571219102013@news.panix.com>
Date Sun, 20 Oct 2013 00:04:13 +1100
Subject Re: Error Testing
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
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.1256.1382187856.18130.python-list@python.org> (permalink)
Lines 22
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1382187856 news.xs4all.nl 15996 [2001:888:2000:d::a6]:52890
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:57098

Show key headers only | View raw


On Sat, Oct 19, 2013 at 11:57 PM, Roy Smith <roy@panix.com> wrote:
> On 10/19/13 8:23 AM, Scott Novinger wrote:
>> > My goal is to make sure that the value entered for the radius is an integer
>> > value.
>
> In article <mailman.1254.1382186691.18130.python-list@python.org>,
>  Ned Batchelder <ned@nedbatchelder.com> wrote:
>
>> First, radius is the result of input(), so it is
>> always a string, never an int.
>
> input() returns ints or floats for values which can be converted to
> those.  I suspect you're thinking of raw_input()?

Negative. The OP stated Python 3.2, in which Ned's statement is
correct. :) In Python 2.x, yes, input() will return an int if it
evaluates as one, but in 2.x, I would STRONGLY advise against ever
using non-raw input(). (To be honest, I'd have to say that the
innocuous name 'input' concealing code evaluation is an embarrassment,
and one that I'm very much glad is now removed from the language.)

ChrisA

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


Thread

Error Testing Scott Novinger <scnovinger@gmail.com> - 2013-10-19 05:23 -0700
  Re: Error Testing Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-10-19 13:37 +0100
    Re: Error Testing Scott Novinger <scnovinger@gmail.com> - 2013-10-19 06:34 -0700
      Re: Error Testing Chris Angelico <rosuav@gmail.com> - 2013-10-20 00:42 +1100
      Re: Error Testing rusi <rustompmody@gmail.com> - 2013-10-19 09:22 -0700
        Re: Error Testing Chris Angelico <rosuav@gmail.com> - 2013-10-20 09:28 +1100
        Re: Error Testing Ned Deily <nad@acm.org> - 2013-10-19 15:46 -0700
        Re: Error Testing Chris Angelico <rosuav@gmail.com> - 2013-10-20 10:02 +1100
        Re: Error Testing Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-10-20 12:18 -0400
  Re: Error Testing Ned Batchelder <ned@nedbatchelder.com> - 2013-10-19 08:44 -0400
    Re: Error Testing Roy Smith <roy@panix.com> - 2013-10-19 08:57 -0400
      Re: Error Testing Chris Angelico <rosuav@gmail.com> - 2013-10-20 00:04 +1100
      Re: Error Testing Ned Batchelder <ned@nedbatchelder.com> - 2013-10-19 09:07 -0400
        Re: Error Testing Roy Smith <roy@panix.com> - 2013-10-19 09:09 -0400
      Re: Error Testing Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-10-19 14:19 +0100
  Re: Error Testing Chris Angelico <rosuav@gmail.com> - 2013-10-20 00:01 +1100
  Re: Error Testing David Robinow <drobinow@gmail.com> - 2013-10-19 14:08 -0400
  Re: Error Testing Tim Chase <tim@thechases.com> - 2013-10-19 13:31 -0500
  Re: Error Testing Terry Reedy <tjreedy@udel.edu> - 2013-10-19 15:50 -0400
  What's wrong with Windows Command Prompt (was Re: Error Testing) Terry Reedy <tjreedy@udel.edu> - 2013-10-19 16:35 -0400
  Re: What's wrong with Windows Command Prompt (was Re: Error Testing) Chris Angelico <rosuav@gmail.com> - 2013-10-20 09:15 +1100
  Re: Error Testing Chris Angelico <rosuav@gmail.com> - 2013-10-20 09:20 +1100
  Re: What's wrong with Windows Command Prompt (was Re: Error Testing) David Robinow <drobinow@gmail.com> - 2013-10-21 15:55 -0400
  Re: What's wrong with Windows Command Prompt (was Re: Error Testing) Tim Chase <python.list@tim.thechases.com> - 2013-10-21 15:29 -0500

csiph-web