On 2014-12-18 14:51, Vincent Knight wrote:
I think that I understood elsewhere that using `is_package_installed` is
preferred over try/except statements...
Please tell that person that he is wrong :-)
There are multiple reasons:
* In general, in Python the try/except idiom is preferred over the
check-then-do idiom. See also
https://docs.python.org/2/glossary.html#term-eafp
* is_package_installed() is a hack: it is slow, it doesn't check for
versions (you cannot detect if somebody installed gambit-0.0.1 instead
of gambit-42.11) and it doesn't work with packages installed through
easy_install, pip or other means.
--
You received this message because you are subscribed to the Google Groups
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.