questions about of writing python scripts

Stephen Boulet stephen at
Mon Dec 10 05:04:42 CET 2001

You could use the 'type' command to find out the type of a variable.

-- Stephen

ed wrote:

> Hi I have a question regarding writing python scripts..
> for large program written i python,, One thing i notice is it needs to
> run to the specifc piece of code i order to detect error. let's say
> the valaue is assigned to a wrong variables, I cannot know in advance,
> say I have
> b = 1 (defined way earlier)
> if x == 1:
>    a = b
> else:
>    a = c
> which a to be used as interger later on.
> x being passed in eariler.
> since b is deinfed I can assign to it,
> but c is floating and has not value and a got assgined to it.  ... in
> other compiation lang, this type of error will be caught in
> compilaiton time, but I can't using python..  is ther any utility or
> way to catch this type of error way ahead?
> thankx

More information about the Python-list mailing list