Reason for not allowing import twice but allowing reload()

alien2utoo at gmail.com alien2utoo at gmail.com
Mon Feb 29 08:00:05 EST 2016


Thanks Chris and Ian,

Your suggested experiments and explanations have really provided some good insights, something Tutorial didn't indicate.

Ian's explanation reminds me of 

#ifndef _HEADER_H_
#define _HEADER_H_
...
#endif  // _HEADER_H_

in C/C++, and I can draw parallels to why subsequent attempts to import same module shouldn't result in flagging an error, and need for multiple imports to refer to same information.


More information about the Python-list mailing list