How to make a module function visible only inside the module?

beginner zyzhu2000 at
Sun Aug 19 02:45:34 CEST 2007

Hi Everyone,

Is there any equivalent version of C's static function in Python. I
know I can make a class function private by starting a function name
with two underscores, but it does not work with module functions.

For exmaple, __func1 is still visible outside the module.
"""my module""

def __func1():
    print "Hello"
import mymodule



More information about the Python-list mailing list