Commits
Click on a commit to change the comparison rangeSupport passing package name as pythran signature
This patch introduces a new argument type of the form `<name> pkg`, for instance `numpy pkg`.
It's a special function export type which, if used, must be used
consistently across all overloads for that exported function.
To support that change, a new pre-processing step has been added. It
performs package inference, and tries hard to statically resolve a
package name based on the lookup made on it. If a single package matches
the constraints, that package is picked. Otherwise nothing is done.
The pythran signature just adds an extra constraint.
For instance,
#pythran export foo(float, numpy pkg)
def foo(x, np):
return np.cos(x)
is equivalent to the following:
#pythran export foo(float, numpy pkg)
def foo(x, _):
import numpy as np
return np.cos(x)
The exported foo function still has two parameters and the second
parameter is going to check that the passed argument is a module named
'numpy'.
Fix #23671 month ago
by serge-sans-paille