Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have an import testing method that does not error out #606

Open
justinGilmer opened this issue Oct 7, 2019 · 2 comments
Open

Have an import testing method that does not error out #606

justinGilmer opened this issue Oct 7, 2019 · 2 comments

Comments

@justinGilmer
Copy link
Contributor

Sometimes we might need to check if an importable module exists, and import if it does and if it does not, move on gracefully. Currently we have the import_ method, which tests an import and then returns an error if the module is not found.

Maybe we want to have a non-error generating import_ method. Most of the times these should error out, but in certain cases it might be useful?

Curious what others think?

Originally posted by @justinGilmer in #604

@mikemhenry
Copy link
Member

maybe import_(module_name, quite=True) so depending the situation we can set quiet=False

@mattwthompson
Copy link
Member

So we want a "try to import, but don't error out if the import fails" flag, which is off by default (by default we would want an error)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants