A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-April/064453.html below:

[Python-Dev] Dropping __init__.py requirement for subpackages

[Python-Dev] Dropping __init__.py requirement for subpackages [Python-Dev] Dropping __init__.py requirement for subpackagesGuido van Rossum guido at python.org
Thu Apr 27 01:57:13 CEST 2006
On 4/26/06, Delaney, Timothy (Tim) <tdelaney at avaya.com> 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/)
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4