On May 16, 9:57 am, HMS Surprise <[EMAIL PROTECTED]> wrote:
> I looked in the language but did not find a switch for requiring
> variables to be declared before use.
>
> Is such an option available?
>
> Thanks,
>
> jvh

You do have to declare a variable before use. You do so by assigning
it a value. You can't use a variable before it has been assigned. In
some ways this is less ambiguous than even C where you can declare a
variable without assigning a value. Also note that this caries the
type information, since the variable is of whatever type was assigned
to it. The only thing it doesn't do is give a unique flag that says
"hey this is where I'm declared", although I suppose you could do that
with a comment.

Matt

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to