mk wrote:
> Hello everyone,
>
> I'm trying to do 'modular importing' in helpers.py, rationale being I 
> don't want to cram it all into helpers.py; several modules and/or 
> developers might want to do things completely independently of each 
> other. My idea was smth like that:
>
> hello_helpers.py:
>
> def import_function():
>       from routes import url_for
>
>
> in helpers.py:
>
> from hello_helpers import import_function
> import_function()
>
> But. That doesn't work.
>   
It shouldn't. "import" inside function will import only into that 
function scope. I think you should use different files and import them. 
Maybe it is possible to do the same with decorators but I'm not sure 
about that.

Regards,
Dalius

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to