Static Typing in Python
Premshree Pillai
premshree_python at yahoo.co.in
Tue Mar 16 07:58:29 EST 2004
--- Bruno Desthuilliers
<bdesth.quelquechose at free.quelquepart.fr> wrote: >
Premshree Pillai wrote:
> > --- Jacek Generowicz <jacek.generowicz at cern.ch>
> > wrote: >
> >
> >>On 13 Mar 2004, at 08:07, Premshree Pillai wrote:
> >>
> >>
> >>>Yes, I am aware that Python is dynamically typed,
> >>
> >>and
> >>
> >>>so is Perl, right? In Perl, we have the "use
> >>
> >>strict
> >>
> >>>vars" pragma to force variable declaration.
> >>
> >>I'm no Perler ... but by reading a bit of
> >>documentation, I get the
> >>impression that you are a bit confused about what
> >>"use strict 'vars'"
> >>really does. It seems to be some mish-mash of
> >>concepts: it imposes the
> >>necessity to fully qualify names, to declare (the
> >>existence, not the
> >>type of) variables with "our", and does some
> control
> >>of scoping rules.
> >>
> >
> >
> > Err...you probably have the wrong idea of static
> > typing, I think. Static typing has to do with
> explicit
> > declaration (initialization) of variables (and not
> of
> > variable types).
>
> I beg your pardon ? Why do you thinks it is called
> 'static *typing*'?
> Static typing has to do with compile-time *type*
> checking, not with
> variables declaration. Believe it or no, there are
> statically (and
> strongly) typed languages that does not enforce
> variable declaration nor
> even type declaration - this is called type
> inference, and you can have
> an exemple in OCaml.
>
>
> > Like in C, C++, etc, Python too is
> > strongly typed,
>
> C is certainly not what I'd call a 'strongly' typed
> langage, since you
> can cast *any* variable to *any* type without the
> compiler complaining.
> If you want *strong* static typing, go for Ada.
In an earlier post, when I mentioned that C/C++ are
stongly typed, I had explicitly mentioned - not
cosidering casting.
-Premshree Pillai
=====
-Premshree
[http://www.qiksearch.com/]
________________________________________________________________________
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
mailing list