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