Just so you guys know, this change allows people with mako, jinja, or
chameleon.genshi default_templates to use "tg components" like
tgext.admin and Catwalk.  Without this, those libraries have to use XML
() all over the place in their templates which also degrades
performance.  The default template already loads TW by default, so I
am uncertain why having TW as a dep. would be a concern.

cheers.
-chris

On Jan 14, 9:34 pm, Chris Miles <[email protected]> wrote:
> On 15/01/2009, at 4:07 AM, Mark Ramm wrote:
>
> > if tg.config.use_toscawidgets:
> >    import tw
> >    tw.framework.default_view = tg.config.tw.framework.default_view
>
> > Makes sense, though you only want to do the import once, not on each  
> > request. ;)
>
> I was going to suggest that there should be no performance penalty  
> when repeating an import as Python only imports a module once.  But  
> even though that is true, it looks like there is still the overhead of  
> processing the import statement and checking whether the import is  
> necessary, assigning the reference, etc.  See
>  http://wiki.python.org/moin/PythonSpeed/PerformanceTips#ImportStateme...
>
> They suggest the use of a global for doing efficient lazy imports.
>
> Cheers,
> Chris Miles
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" 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/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to