Can global variable be passed into Python function?

Mark H. Harris harrismh777 at
Sat Mar 1 02:08:45 CET 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:
      case LT_1:
      case IS_1:
         a = gpi/4
      case IS_n1:
         a = -gpi/4

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


More information about the Python-list mailing list