abakan-zz / napi

Array operations simplified
napi.rtfd.org
MIT License
2 stars 0 forks source link

Napi is broken with latest IPython #1

Open edschofield opened 9 years ago

edschofield commented 9 years ago

Hi Ahmet,

Thanks for creating Napi! I found it while looking for some examples of writing custom IPython magics with AST transformations.

With IPython 3.2.1 and Python 3.4, I get this:

In [1]: import napi

In [2]: %napi
napi transformer is ON

In [3]: import numpy as np

In [4]: a = np.arange(10**6)

In [5]: 10 <= a < 20
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/Users/schofield/anaconda/lib/python3.4/codeop.py in __call__(self, source, filename, symbol)
    131 
    132     def __call__(self, source, filename, symbol):
--> 133         codeob = compile(source, filename, symbol, self.flags, 1)
    134         for feature in _features:
    135             if codeob.co_flags & feature.compiler_flag:

TypeError: non-numeric type in Num

Any ideas?

abakan-zz commented 9 years ago

This works with Python 2.7.8. Problem has to do with Python 3.4, probably with changes in codeop module. I couldn't see something useful in change logs though, but I will investigate further when I find a chance.