argument type

It's me itsme at yahoo.com
Tue Dec 28 00:50:08 EST 2004


<snip>

>
>     def abc(arg1, arg2, arg3)
>         if isinstance(arg2,(list,tuple)):
>             for item in arg2:
>                 abc(arg1, item)

Typo:

                   abc(arg1, item, arg3)

<snip>

> and likewise, I can do:
>
>     abc(1,["String 1","String 2"],5)
>
> Am I on the right track?
>

Let me reiterate that in this case, I know the first and last argument are
numbers but I don't know if the second argument is one string, or a bunch of
strings.   Hence, I would think that I *do* need to use the "look before
leap" (I like that term) type style.






More information about the Python-list mailing list