On 4/26/06, Delaney, Timothy (Tim) <[EMAIL PROTECTED]> wrote: > Potential packages later in the path won't be > warned about. If you're trying to resolve import problems, it's just as > likely that the package you really want is later in sys.path than > earlier.
But module hiding is a feature, and anyway, we're not going to continue to search sys.path after we've found a valid match (imagine doing this on *every* successful import!), so you're not going to get warnings about those either way. > Obviously in the case that you get an ImportError this goes > away. Right. > > Is it also useful to distinguish a subpackage from a non-subpackage? > > Possibly. Perhaps it would be useful to have `is_package(dirname)`, > `is_rootpackage(dirname)` and `is_subpackage(dirname)` functions > somewhere (pkgutils?). YAGNI. Also note that not all modules or packages are represented by pathnames -- they could live in zip files, or be accessed via whatever other magic an import handler users. (Thomas's warning won't happen in those cases BTW -- it only affects the default import handler.) -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com