Perl is worse!

Alex Martelli alex at magenta.com
Fri Jul 28 17:17:52 EDT 2000


"Steve Lamb" <grey at despair.rpglink.com> wrote in message
news:slrn8o3fei.49c.grey at teleute.rpglink.com...
> On 28 Jul 2000 16:49:31 GMT, gbreed at cix.compulink.co.uk
> <gbreed at cix.compulink.co.uk> wrote:
> >?  You said it was only declared to "get the name space in there".
>
>     Yup.  "I'm going to use a, for what I know not.  Could be string,
could be
> integer, could be whatever I want."  The point was defining the name and
> assiciate it with nothing.  But since the type is inferred on first use
might
> as well have the C declarations.

No, there is no type-inferences about variables in Python, neither
on first use nor on later ones.

It serves no purpose that I can think of, in Python, to state to
the compiler "I'm going to use a, for what I know not", in advance
of when you know what you do want with it.  Just bind it in the
appropriate manner at the instant in which you do want to know,
and feel free to rebind it later (or delete it, whatever) if and
when you change your mind.

Whatever a was bound to, or whether it was bound at all, will
make no difference when you later bind or rebind it.  If you
need or want to make tests about a, call methods on it, etc,
then of course it will matter what if anything it is bound to
at that point; but not for the purpose of (re)binding it.


Alex






More information about the Python-list mailing list