Can global variable be passed into Python function?

Mark H. Harris harrismh777 at gmail.com
Fri Feb 28 20:08:45 EST 2014


On Friday, February 28, 2014 6:40:06 PM UTC-6, Ned Batchelder wrote:

> 
> I don't understand: you show an if/elif chain that cannot be expressed 
> as a switch statement (because it uses < ), and then conclude that 
> Python needs a switch statement?  That doesn't make any sense.
> 

Forgive me.  I would rewrite the structure,

   switch x:
      case GT_1:
          __atan__Gt_1__(x)
      case LT_1:
         __atan__Lt_1__(x)
      case IS_1:
         a = gpi/4
      case IS_n1:
         a = -gpi/4
      default:
         __atan__(x)

 or somesuch...   way better...  yes, there are some issues, but all workable with some effort

marcus



More information about the Python-list mailing list