Re: [Tutor] Who uses input()? [was Re: question on input]

2005-07-18 Thread Nathan Pinno
  Terry and all,

  I thought something like this might popup.

  I find it easier to remember and faster to code than int(raw_input()). The 
faster I can code a program, the better in my opinion. So what if it has a 
few bugs, I fix them gradually.

  Nathan Pinno
  - Original Message - 
  From: Terry Reedy [EMAIL PROTECTED]
  To: python-list@python.org
  Sent: Monday, July 18, 2005 1:04 AM
  Subject: Re: Who uses input()? [was Re: question on input]


  
   Nathan Pinno [EMAIL PROTECTED] wrote in message
   news:[EMAIL PROTECTED]
I use input() all the time. I know many people say it ain't safe, but
   whose going to use it to crash their own comp? Only an insane person
   would,
  
   This is usage Guido intended it for, not for production apps distributed 
to
   world.
  
  
  
   -- 
   http://mail.python.org/mailman/listinfo/python-list
  
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Who uses input()? [was Re: question on input]

2005-07-18 Thread Nathan Pinno
  Danny,

  It sure did, though I wish there was an easier way of coding it than 
int(raw_input())! Any ideas would gladly be appreciated.

  By the way, is there any code floating out there that can show how many 
possible mixtures there are, e.g. for x0, x1, x2, x3, and a0, a1, a2, and a3 
for example. If there is, show me it, please. I'm getting confused writing 
my MasterMind and don't want to screw up bad, e.g. repeat the same answer in 
a different way.

  Thanks,
  Nathan Pinno.
  - Original Message - 
  From: Danny Yoo [EMAIL PROTECTED]
  To: Nathan Pinno [EMAIL PROTECTED]
  Cc: Terry Reedy [EMAIL PROTECTED]; tutor@python.org
  Sent: Monday, July 18, 2005 2:14 AM
  Subject: Re: [Tutor] Who uses input()? [was Re: question on input]


  
  
   On Mon, 18 Jul 2005, Nathan Pinno wrote:
  
   I find it easier to remember and faster to code than int(raw_input()).
   The faster I can code a program, the better in my opinion. So what if 
it
   has a few bugs, I fix them gradually.
  
   Hi Nathan
  
   You're right, just as long as we're writing programs that are only meant
   to be used by ourselves, and as long as we're sure that it's not talking
   to the outside world.  The driving issue behind getting paranoid is 
this:
   it's getting much easier to write programs that we think might be just 
for
   ourselves, but which become useful for others.
  
   And as soon as we write programs that other people are going to use, we
   really do have to play by a different set of rules than just ease of
   programming.  Some folks were casual about eval(), and look what 
happened
   to them:
  
  http://gulftech.org/?node=researcharticle_id=00088-07022005
  
   They should have known better.
  
   This problem is not exclusive to programmers in PHP:  programmers in
   Python make the same kind of mistakes.  As a concrete example, take a 
look
   at the comments about the deprecated SimpleCookie and SerialCookie
   functions:
  
  http://www.python.org/doc/lib/module-Cookie.html
  
   Again, they should have known better.  And we should know better.
  
   So we do have a responsibility to state up front that using 'eval' (or
   things that call 'eval' for us) is convenient, but it's not safe. 
That's
   why we bug about it every so often.
  
  
   Hope this helps!
  
  
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor