L
Lev Elblert
Acording to documentation the are 2 ways to "hide" functions, data
inside the module:
1. __all__ list
2. starting "hiden" names with underscore.
None of these methods does not work:
############################################
#File: foo.py
import sys
__all__ = ['B']
def A():
print "In A"
def B():
print "In B"
def _C():
print "In _C"
############################################
#File: a.py
import foo
print dir(foo)
foo.A()
foo.B()
foo._C()
Running a.py produces this output:
['A', 'B', '_C', '__all__', '__builtins__', '__doc__', '__file__',
'__name__', 'sys']
In A
In B
In _C
Can somebody explain this?
I'm working on Windows Python 2.3
Thanks in advance
inside the module:
1. __all__ list
2. starting "hiden" names with underscore.
None of these methods does not work:
############################################
#File: foo.py
import sys
__all__ = ['B']
def A():
print "In A"
def B():
print "In B"
def _C():
print "In _C"
############################################
#File: a.py
import foo
print dir(foo)
foo.A()
foo.B()
foo._C()
Running a.py produces this output:
['A', 'B', '_C', '__all__', '__builtins__', '__doc__', '__file__',
'__name__', 'sys']
In A
In B
In _C
Can somebody explain this?
I'm working on Windows Python 2.3
Thanks in advance