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


Groups > comp.lang.python > #3914

Re: learnpython.org - an online interactive Python tutorial

From rantingrick <rantingrick@gmail.com>
Newsgroups comp.lang.python
Subject Re: learnpython.org - an online interactive Python tutorial
Date 2011-04-23 08:21 -0700
Organization http://groups.google.com
Message-ID <4c062ea7-9a1b-495e-99af-31ed1b59a1f1@r23g2000vbp.googlegroups.com> (permalink)
References <506eb5e4-4f29-473a-8d47-2082322e005e@glegroupsg2000goo.googlegroups.com> <201104211710.19587.akabaila@pcug.org.au> <BANLkTimCG4v8j+St0aSaqkMomhyHp5VYhA@mail.gmail.com> <mailman.687.1303371055.9059.python-list@python.org> <yn9sp.39116$yp3.16271@newsfe09.iad>

Show all headers | View raw


On Apr 22, 1:38 am, harrismh777 <harrismh...@charter.net> wrote:

> Strings should auto-type-promote to numbers if appropriate.

No they should not! We do not want a language to "guess" our
intentions. We are big boys and girls and should be responsible for
own actions.

> This behavior should occur in input() as well. If a 'number' string is
> entered and can be converted to a Python number (whatever I mean by that
> at the moment) then the string should be converted to a number (int or
> float as appropriate) and the input() should return a reference to the
> number type  ( a value );  otherwise, input() should return the string
> entered, or throw a type error.

No, no, no! This is evil! That is what "eval" is for my friend.

> If an operation like (+) is used to add  1 + '1' then the string should
> be converted to int and the addition should take place, returning a
> reference to object int (2).

My god man,  have you gone completely insane? 8-O

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


Thread

learnpython.org - an online interactive Python tutorial Ron <ron.reiter@gmail.com> - 2011-04-20 10:15 -0700
  Re: learnpython.org - an online interactive Python tutorial Matty Sarro <msarro@gmail.com> - 2011-04-20 13:57 -0400
  Re: learnpython.org - an online interactive Python tutorial Terry Reedy <tjreedy@udel.edu> - 2011-04-20 18:12 -0400
  Re: learnpython.org - an online interactive Python tutorial Chris Angelico <rosuav@gmail.com> - 2011-04-21 14:07 +1000
  Re: learnpython.org - an online interactive Python tutorial Algis Kabaila <akabaila@pcug.org.au> - 2011-04-21 17:10 +1000
    Re: learnpython.org - an online interactive Python tutorial harrismh777 <harrismh777@charter.net> - 2011-04-21 02:29 -0500
  Re: learnpython.org - an online interactive Python tutorial Chris Angelico <rosuav@gmail.com> - 2011-04-21 17:19 +1000
  Re: learnpython.org - an online interactive Python tutorial Heiko Wundram <modelnine@modelnine.org> - 2011-04-21 09:30 +0200
    Re: learnpython.org - an online interactive Python tutorial harrismh777 <harrismh777@charter.net> - 2011-04-22 01:38 -0500
      Re: learnpython.org - an online interactive Python tutorial Chris Angelico <rosuav@gmail.com> - 2011-04-22 17:08 +1000
        Re: learnpython.org - an online interactive Python tutorial harrismh777 <harrismh777@charter.net> - 2011-04-23 19:37 -0500
          Re: learnpython.org - an online interactive Python tutorial Cameron Simpson <cs@zip.com.au> - 2011-04-24 12:23 +1000
            Re: learnpython.org - an online interactive Python tutorial harrismh777 <harrismh777@charter.net> - 2011-04-23 21:39 -0500
              Re: Re: learnpython.org - an online interactive Python tutorial Dave Angel <davea@ieee.org> - 2011-04-24 07:16 -0400
                Re: learnpython.org - an online interactive Python tutorial harrismh777 <harrismh777@charter.net> - 2011-04-25 01:14 -0500
      Re: learnpython.org - an online interactive Python tutorial Mel <mwilson@the-wire.com> - 2011-04-22 09:07 -0400
        Re: learnpython.org - an online interactive Python tutorial Roy Smith <roy@panix.com> - 2011-04-22 09:22 -0400
      Re: learnpython.org - an online interactive Python tutorial Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-04-22 23:28 -0700
        Re: learnpython.org - an online interactive Python tutorial flebber <flebber.crue@gmail.com> - 2011-04-23 05:49 -0700
          Re: learnpython.org - an online interactive Python tutorial Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-04-23 11:01 -0700
        Re: learnpython.org - an online interactive Python tutorial rantingrick <rantingrick@gmail.com> - 2011-04-23 08:16 -0700
      Re: learnpython.org - an online interactive Python tutorial rantingrick <rantingrick@gmail.com> - 2011-04-23 08:21 -0700
      Re: learnpython.org - an online interactive Python tutorial Dotan Cohen <dotancohen@gmail.com> - 2011-04-23 19:51 +0300
      Re: learnpython.org - an online interactive Python tutorial Tim Chase <python.list@tim.thechases.com> - 2011-04-23 12:25 -0500
      Re: learnpython.org - an online interactive Python tutorial Westley Martínez <anikom15@gmail.com> - 2011-04-23 12:38 -0700
      Re: learnpython.org - an online interactive Python tutorial Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-04-24 00:42 +0000
        Re: learnpython.org - an online interactive Python tutorial Chris Angelico <rosuav@gmail.com> - 2011-04-24 11:35 +1000
          Re: learnpython.org - an online interactive Python tutorial Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-04-24 08:13 +0000
            Re: learnpython.org - an online interactive Python tutorial Chris Angelico <rosuav@gmail.com> - 2011-04-24 18:21 +1000
        Re: learnpython.org - an online interactive Python tutorial harrismh777 <harrismh777@charter.net> - 2011-04-23 22:10 -0500
          Re: learnpython.org - an online interactive Python tutorial Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-04-24 09:18 +0000
            Re: learnpython.org - an online interactive Python tutorial harrismh777 <harrismh777@charter.net> - 2011-04-25 01:20 -0500
              Re: learnpython.org - an online interactive Python tutorial Terry Reedy <tjreedy@udel.edu> - 2011-04-25 11:43 -0400
              Re: learnpython.org - an online interactive Python tutorial Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-04-26 13:06 +1200
          Re: learnpython.org - an online interactive Python tutorial jmfauth <wxjmfauth@gmail.com> - 2011-04-24 08:15 -0700
  Re: learnpython.org - an online interactive Python tutorial Westley Martínez <anikom15@gmail.com> - 2011-04-21 07:14 -0700
  Re: learnpython.org - an online interactive Python tutorial MRAB <python@mrabarnett.plus.com> - 2011-04-21 17:13 +0100
  Re: learnpython.org - an online interactive Python tutorial Dotan Cohen <dotancohen@gmail.com> - 2011-04-23 16:45 +0300

csiph-web