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/2004-July/046457.html below:

[Python-Dev] Fix import errors to have data

[Python-Dev] Fix import errors to have data [Python-Dev] Fix import errors to have dataGuido van Rossum guido at python.org
Tue Jul 27 22:44:15 CEST 2004
> No.  I'm proposing a way for a Python developer to detect the
> presence or absence of a module.
> 
> Hm, perhaps it would be better to provide an API (if there isn't one
> already) to test whether a module is present.
> 
> AFAIK, the only way to do it is by trying the import.  Unfortunately,
> the error type alone isn't enough to tell whether the error you
> caught is due to the error condition you are trying to test.
> 
> Perhaps providing an API is a better way to go.

This exists as imp.find_module.

> In general, however, I hate the approach of formatting errors
> as they are raised, rather than as they are converted to strings.

Agreed.

--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