2

Currently i am creating a custom import hook, which seems to work pretty well (still under development). When i read the PEP 302 i came accross the __name__ attribute, which is descriped like this:

The __name__ attribute must be set. If one uses imp.new_module() then the attribute is set automatically.

But i don't get, whether name should contains the full path of the module/package or just it's name. For example when executing import A.B should __name__ only contains B or the full path A.B?

Thank you very much!

BendEg
  • 20,098
  • 17
  • 57
  • 131

0 Answers0