Graham Dumpleton
grahamd at dscpl.com.au
Wed Jun 29 02:31:00 EDT 2005
Graham Dumpleton wrote .. > Julien wrote .. > > > import os.path > > You don't need to explictly import "os.path", it is sufficient to import > just "os" > as it will import approriate module as "path". I only mention this as there > is an > obtuse comment in Python source code which suggests that import "os.path" > may be frowned upon and a special check required because people do do it. > > # Grrr, some people "import os.path" > if len(parts) == 2 and hasattr(top_module, parts[1]): > return top_module I had one direct email commenting on this, so after a little bit more research, can only assume that this is because the "os" module isn't a package yet a mechanism designed for importing sub modules or sub packages of a package is being used. Graham
|