On Mon, Aug 16, 2010 at 5:08 PM, mda_ <donmorri...@gmail.com> wrote: >> system to be more modular. Is there even an efficient method in Python >> of conditionally including code based on availability of prereqs? I
try: import foo except ImportError: # do something to note that the module foo isn't available > > Since I'm a sage-noob, I don't know if my answer is relevant > enough....However, the import statement in python, in general, has > been misused in the past. > > An excerpt from "What's new in Python 3.1": > http://docs.python.org/dev/py3k/whatsnew/3.1.html > > A new module, importlib was added. It provides a complete, portable, > pure Python reference implementation of the import statement and its > counterpart, the __import__() function. It represents a substantial > step forward in documenting and defining the actions that take place > during imports. > > (Contributed by Brett Cannon.) > > -- > To post to this group, send an email to sage-devel@googlegroups.com > To unsubscribe from this group, send an email to > sage-devel+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/sage-devel > URL: http://www.sagemath.org > -- William Stein Professor of Mathematics University of Washington http://wstein.org -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org