On Sun, Jun 01, 2014 at 05:04:07AM -0700, pbrunet wrote:
> In pythran/optimizations/constant_folding.py:
> > +            else:
> > +                raise ConstantFolding.ToNotEval()
> > +        elif isinstance(value, types.NoneType):
> > +            return ast.Attribute(ast.Name('__builtin__', ast.Load()),
> > +                                 'None',
> > +                                 ast.Load())
> > +        elif isinstance(value, numpy.ndarray):
> > +            return ast.Call(func=ast.Attribute(ast.Name('numpy', ast.Load
> ()),
> > +                                               'array',
> > +                                               ast.Load()),
> > +                            args=[self.to_ast(value.tolist())],
> > +                            keywords=[],
> > +                            starargs=None,
> > +                            kwargs=None)
> > +        elif any(isinstance(value, x) for x in (numpy.float64,
> numpy.float32,
> > +                                                numpy.uint32, numpy.int16)):
> Yes, they could be added. But it shows that others are never tested with
> constant folding...
What are you waiting for :-)