Re: "no variable or argument declarations are necessary."
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: "no variable or argument declarations are necessary."

From: bruno modulix <onurb@xiludom.gro>
Date: Mon Oct 03 2005 - 15:13:43 CEST

James A. Donald wrote:
> James A. Donald:
>
>> > Surely that means that if I misspell a variable name, my program will
>> > mysteriously fail to work with no error message.
>
>
> On Sun, 02 Oct 2005 17:11:13 -0400, Jean-François Doyon
>
>>No, the error message will be pretty clear actually :)
>
>
> Now why, I wonder, does this loop never end :-)
> egold = 0
> while egold < 10:
> ego1d = egold+1
>

A more pythonic style would be:

egold = 0
while egold < 10:
  ego1d += 1

And that one raises a name error !-)

-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb@xiludom.gro'.split('@')])"
Received on Sat Oct 15 04:04:45 2005