[Tutor] Named-value formatting fails

Tim Johnson tim at johnsons-web.com
Sun Jan 9 17:26:44 CET 2011


* Steven D'Aprano <steve at pearwood.info> [110108 19:46]:
> A more detailed response.
>
> Dear me... messing with globals and locals. That's always a bad sign.  
> But let's assume this is that one time in 100 that it is actually  
> justified...
>
>>         if localvals is None:             self.locals = 
>> sys._getframe(1).f_locals
>
> Are you aware that this is non-portable and subject to change without  
> notice?
  No! 
  1)Can you explain further?

  And you have convinced me, and furthermore given me enough to
  convince someone else that a different approach would be safer.
  2)Can you recommend a *simple* templatting module?

  thanks
-- 
Tim 
tim at johnsons-web.com or akwebsoft.com
http://www.akwebsoft.com


More information about the Tutor mailing list