Can global variable be passed into Python function?

Michael Torrie torriem at gmail.com
Sun Mar 2 19:48:15 CET 2014


On 03/02/2014 03:07 AM, Chris Angelico wrote:
> 
>>>> import os
>>>> type(os.POSIX_FADV_RANDOM)
> <class 'int'>
> 
> So use ==. If it's later changed and you have to instead use 'is', you
> can change your code.

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




More information about the Python-list mailing list