Brett Cannon added the comment: In this instance where there are only a set number of options are expected to be officially valid, yes I think enums are a good fit.
As for strings, the only way I would be okay with that is defining the strings either as attributes on ImportError itself or off of importlib to make it easy to do a comparison. But in that case I might as well just drop _not_found and use ``str(exc).startswith('No module named ')`` to detect what I need and be done with it. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue15767> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com