3 ms·
Read the article, that was discussed and dismissed. It doesn't make accio 'act as import' because import is a keyword not a function call.
by jodrellblank 13y ago
Read the article, that was discussed and dismissed. It doesn't make accio 'act as import' because import is a keyword not a function call.
- daGrevis 13y agoimport is a statement. __import__ is a function hence will work. In [1]: accio = __import__ In [2]: accio("os") Out[2]: <module 'os' from '/usr/lib/python2.7/os.pyc'>
- raimondious 13y agoFrom the article... >>> accio = __builtins__.__import__ >>> accio sys File "<stdin>", line 1 accio sys ^ SyntaxError: invalid syntax # :( The author wanted accio to replace import not __import__.