Static Typing in Python
premshree_python at yahoo.co.in
Wed Mar 17 16:37:27 CET 2004
--- Dang Griffith <google0 at lazytwinacres.net> wrote:
> On Tue, 16 Mar 2004 02:28:15 +0000 (GMT), Premshree
> <premshree_python at yahoo.co.in> wrote:
> > --- Joe Mason <joe at notcharles.ca> wrote: > In
><mailman.11.1079347355.12241.python-list at python.org>,
> >> Premshree Pillai wrote:
> >> > Err...you probably have the wrong idea of
> >> > typing, I think. Static typing has to do with
> >> explicit
> >> > declaration (initialization) of variables (and
> >> of
> >> > variable types). Like in C, C++, etc, Python
> >> is
> >> Is that an official definition from somewhere?
> >> Cause I always thought
> >> static typing was about variable types.
> >> Joe
> >> --
> >Hmm...I might have been a little wrong there.
> >what I wanted to stress was that it's the explicit
> >declaration of the variable that matters (that
> >static typing what it is).
> Static typing does not have to do with explicit
> As you said earlier, Perl has an option to force
> declaration, and yet Perl is not statically typed.
> Python function
> arguments are explicitly declared, but are
> dynamically typed.
Perl as it is is dynamically typed; the pragma used to
enforce variable declaration is only an *option* and
thus does not decide whether Perl is statically typed
or dynamically typed. Your comment suggests that you
are trying to justify that "Perl can enforce variable
declaration, but still it is dynamically typed", which
is incorrect to suggest.
Oh, and thanks, you have been helpful!
> It seems you want the compiler to complain when a
> previously unused/unnamed/undeclared variable is
> used on the left side of an equation. (It already
> for vars on the right side and in expressions.)
> I think there is value in detecting such problems,
> but I
> think there is enough evidence in existing Python
> that there is little value to having it *in the
> itself*. As other posters have pointed out, there
> other ways of detecting these problems, such as with
> pychecker and PyRex.
> I'm bowing out of this discussion. I hope I have
> somewhat helpful. The strong/weak/static/dynamic
> discussion has gone on many times before, and I
> see it as being particularly relevant to explicit
> I'm pretty sure you have the answer to your
> Python does not force, or even support, variable
> If you want that, you'll need to look to one of the
> tools mentioned.
> Best wishes in your endeavors,
> --Daniel 'dang' Griffith
> (Yes, I know Python supports variable/keyword
> to functions, which don't require explicit
Yahoo! India Insurance Special: Be informed on the best policies, services, tools and more.
Go to: http://in.insurance.yahoo.com/licspecial/index.html
More information about the Python-list