What does the keyword 'global' really mean

John Dean john at rygannon.com
Tue Sep 9 07:03:43 EDT 2003


Hi
I have been looking through some Python code and I came across the keyword
'global'. I have looked through the docs and two or three Python programming
books for a full explanation of what 'global' really means. Would I be
correct in assuming that any variable prefixed with the keyword global would
allow that variable to be accessible across translation units, in other
words global is equivalent to the 'C' keyword 'extern' ?

Also, does Python have the equivalent of the 'C' keyword 'static'?

-- 
Best Regards
John




More information about the Python-list mailing list