Can global variable be passed into Python function?

Gregory Ewing greg.ewing at canterbury.ac.nz
Fri Feb 28 22:10:10 EST 2014


Mark H. Harris wrote:

>     if (n**2 < D(1)):
>         a = __atan__(n)
>     elif (n == D(1)):
>         a = gpi/4
>     elif (n == D(-1)):
>         a = -(gpi/4)
>     elif (n < D(-1)):
>         a = __atan__Lt_neg1__(n)
>     else:
>         a = __atan__Gt_1__(n)

That's not a candidate for a switch statement, because
the comparisons are not all equality comparisons.

-- 
Greg



More information about the Python-list mailing list