Import user-defined module

Import user-defined module.

On 07/10/2014 08:24, serge-sans-paille wrote:
>
> In pythran/transformations/handle_import.py:
>
> > +            # Direct call, resolve in the current module.
> > +            # Note: the function is not necessarily locally defined, it could
> > +            # be imported in the form "from bar import foo"
> > +            func_name = call_node.func.id
> > +            if func_name in self.nested_functions:
> > +                #Don't need to do anything in this case, nested function are
> > +                #implicitly imported with the current function
> > +                return call_node
> > +
> > +            # Import the function now, imply a recursion to import the callee
> > +            mangled_name = self.module.call_function(self.registry,
> > +                                                     func_name)
> > +            # Patch the call site, replacing with the mangle name
> > +            call_node.func.id = mangled_name
> > +        elif (isinstance(call_node.func, ast.Attribute) and
> > +              isinstance(call_node.func.value, ast.Name)):
> I agree. I say it is "dynamic" because there is aliasing. It just 
> happens that in this case a powerful static analysis (aliasing) can 
> statically decide. Now what are you suggesting ? I can just include 
> any function referenced and not only called, would it do the trick?
> Yes :-)
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/serge-sans-paille/pythran/pull/242/files#r18502347>.
>
Why do you want to include all of them? In which case aliased function 
is not enough? (Include only aliased function have more chance to 
compile with the greedy typing of Pythran)