Re: "no variable or argument declarations are necessary."
- From: Antoon Pardon <apardon@xxxxxxxxxxxxxxx>
- Date: 3 Oct 2005 06:59:04 GMT
Op 2005-10-03, George Sakkis schreef <gsakkis@xxxxxxxxxxx>:
> "Michael" <ms@xxxxxxxxxxxx> wrote:
>
>> James A. Donald wrote:
>> > On Sun, 02 Oct 2005 17:11:13 -0400, Jean-Francois Doyon
>> > James A. Donald:
>> >> > Surely that means that if I misspell a variable name, my program will
>> >> > mysteriously fail to work with no error message.
>> >> 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
>>
>> I know (hope! :-) that's a tongue-in-cheek question, however the answer as
>> to why that's not a problem is more to do with development habits rather
>> than language enforcement. (yes with bad habits that can and will happen)
>>
>> [snipped description of test-driven development culture]
>
> As an aside, more to the point of the specific erroneous example is the lack of the standard python
> idiom for iteration:
>
> for egold in xrange(10):
> pass
>
> Learning and using standard idioms is an essential part of learning a language; python is no
> exception to this.
Well I'm a bit getting sick of those references to standard idioms.
There are moments those standard idioms don't work, while the
gist of the OP's remark still stands like:
egold = 0:
while egold < 10:
if test():
ego1d = egold + 1
--
Antoon Pardon
.
- Follow-Ups:
- Re: "no variable or argument declarations are necessary."
- From: Steven D'Aprano
- Re: "no variable or argument declarations are necessary."
- From: Duncan Booth
- Re: "no variable or argument declarations are necessary."
- References:
- "no variable or argument declarations are necessary."
- From: James A . Donald
- Re: "no variable or argument declarations are necessary."
- From: Jean-François Doyon
- Re: "no variable or argument declarations are necessary."
- From: James A . Donald
- Re: "no variable or argument declarations are necessary."
- From: Michael
- Re: "no variable or argument declarations are necessary."
- From: George Sakkis
- "no variable or argument declarations are necessary."
- Prev by Date: Re: Bwidget for tkinter
- Next by Date: Re: Will python never intend to support private, protected and public?
- Previous by thread: Re: "no variable or argument declarations are necessary."
- Next by thread: Re: "no variable or argument declarations are necessary."
- Index(es):