Can global variable be passed into Python function?

Marko Rauhamaa marko at
Sun Mar 2 22:03:30 CET 2014

Michael Torrie <torriem at>:

> I don't see why == wouldn't continue to work if os.POSIX_FADV_RANDOM
> became an object of a different type.

It probably would.

If one were begging for trouble, one *could* define:

   class ABC:
       A = 1
       B = 1.0
       C = 1+0j


   ABC.A == ABC.B
   ABC.B == ABC.C
   ABC.C == ABC.A


   ABC.A is not ABC.B
   ABC.B is not ABC.C
   ABC.C is not ABC.A


More information about the Python-list mailing list