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



Paul Rubin wrote:
Antoon Pardon <apardon@xxxxxxxxxxxxxxx> writes:

Or you just code without declaring, intending to go back and do it later, and invariably forget.

What's the problem, the compilor will allert you to your forgetfullness and you can then correct them all at once.


Thiat in fact happens to me all the time and is an annoying aspect of
Python.  If I forget to declare several variables in C, the compiler
gives me several warning messages and I fix them in one edit.  If I
forget to initialize several variables in Python, I need a separate
test-edit cycle to hit the runtime error for each one.

Well I hope you aren't suggesting that declaring variables makes it impossible to forget to initalise them. So I don;t really see the relevance of this remark, since you simply add an extra run to fix up the "forgot to declare" problem. After that you get precisely one runtime error per "forgot to initialize".


regards
 Steve
--
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC                     www.holdenweb.com
PyCon TX 2006                  www.python.org/pycon/

.



Relevant Pages

  • Re: Proposal for adding symbols within Python
    ... > If you don't declare your symbols, how will you get the ones that you want? ... Well, just as Python do not need variable declaration, you can just ... >>pythonic IMO (impossible to fix ... ... > Are you suggesting that the Python language designers should somehow ...
    (comp.lang.python)
  • Re: xmlrpc, httplib and SSL
    ... the SSL builtin to Python 2.3, so the latter builds yet another ... I *am not* volunteering to fix this. ... I can't even test fixes ... I will provide moral support and the ...
    (comp.lang.python)
  • Re: mutable default parameter problem [Prothon]
    ... I love Python dearly. ... So far you have only shown me an idiom that many say should not be used. ... If I also might make a general argument for the fix then let me continue. ... Dynamic var scoping fixed another Python gotcha which doesn't break ...
    (comp.lang.python)
  • Re: python newbie
    ... are implicitly declared via the first assignment. ... It isn't at all, Python has dynamic typing. ... function which opens a file. ... Traditionally, I would declare the ...
    (comp.lang.python)
  • Re: Bug in Python class static variable?
    ... When I run "python w.py", ... statement executes: the first 'from a import *' will load and execute ... just imports names defined in the main script *before* a was ... exist until the lines which declare them have been executed. ...
    (comp.lang.python)