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/2012-April/118821.html below:

[Python-Dev] making the import machinery explicit

[Python-Dev] making the import machinery explicit [Python-Dev] making the import machinery explicitBrett Cannon brett at python.org
Tue Apr 17 20:01:18 CEST 2012
On Tue, Apr 17, 2012 at 13:45, Philip Jenvey <pjenvey at underboss.org> wrote:

>
> On Apr 14, 2012, at 1:03 PM, Brett Cannon wrote:
>
> > And lastly, sticking None in sys.path_importer_cache would no longer
> mean "do the implicit thing" and instead would mean the same as
> NullImporter does now (which also means import can put None into
> sys.path_importer_cache instead of NullImporter): no finder is available
> for an entry on sys.path when None is found.
>
> Isn't it more explicit to cache the NullImporter instead of None?
>

I disagree. NullImporter is just another finder that just so happens to
always fail. None is explicitly not a finder and thus obviously not going
to do anything. Isn't it clearer to say ``sys.path_importer_cache[path] is
None`` than ``isinstance(sys.path_importer_cache[path],
imp.NullImporter)``? I mean we have None to represent something is nothing
which is exactly what I want to convey; None in sys.path_importer_cache
means there is no finder for that path.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20120417/6b10fd20/attachment.html>
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