serge-sans-paille / pythran

Ahead of Time compiler for numeric kernels
https://pythran.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.99k stars 193 forks source link

Problem with make_tuple #2093

Closed Dapid closed 1 year ago

Dapid commented 1 year ago

From the mailing list:

This fails

#pythran export foobar(int:complex dict)
def foobar(pts):
     for i, p in pts.items():
         return p

Also setting the keys to anything else than int, as long as the values are complex.

The error is

/home/david/.virtualenv/py39/lib/python3.9/site-packages/pythran/pythonic/types/dict.hpp:36:22: error: call of overloaded ‘make_tuple(const long int&, const std::complex<double>&)’ is ambiguous
   36 |     return make_tuple(tmp.first, tmp.second);
      |            ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~

This works, though, so tuples can take complex values:

#pythran export foo(complex, int)
def foo(a, b):
    return (a, b)