where is the '__path__' comes from
python
Solution
You really need to read some Python documentation and learn the basics of the language.
I checked, and you seem to speak Chinese. Here are Python documentation resources in Chinese:
http://www6.uniovi.es/python/doc/NonEnglish.html#chinese
Now, to answer your question. I wasn't sure what the answer was, so I used Google. I did a Google search for "`Python __path__`" and very quickly found:
http://docs.python.org/tutorial/modules.html
6.4.3. Packages in Multiple Directories
Packages support one more special attribute, `__path__`. This is initialized to be a list containing the name of the directory holding the package’s `__init__.py` before the code in that file is executed. This variable can be modified; doing so affects future searches for modules and subpackages contained in the package.
While this feature is not often needed, it can be used to extend the set of modules found in a package.
Problem
i can't find who defined the `'__path__'`,why `'__path__'` can be use. ``` import os import sys import warnings import ConfigParser # ConfigParser is not a virtualenv module, so we can use it to find the stdlib dirname = os.path.dirname distutils_path = os.path.join(os.path.dirname(ConfigParser.__file__), 'distutils') if os.path.normpath(distutils_path) == os.path.dirname(os.path.normpath(__file__)): warnings.warn( "The virtualenv distutils package at %s appears to be in the same location as the system distutils?") else: __path__.insert(0, distutils_path)#who defined me.??? exec open(os.path.join(distutils_path, '__init__.py')).read() ```