Hi.

On Tue, Jul 22, 2008 at 5:41 AM, Michael Bayer <[EMAIL PROTECTED]> wrote:
> On Jul 21, 6:29 pm, "Hanno Schlichting" <[EMAIL PROTECTED]>
> wrote:
>>
>> Hhm, somewhat obfuscated code ;)
>
> well we did the cheetah thing and made sure we used names that would
> never conflict with end-user variables (originally we had some
> conflicts).

That's where we do a proper analysis of the variables in use and do
local scoping of them via the _tmp<x> variables. The other basic rule
is that we disallow variable names that start with an underscore to be
used.

>> Our _out uses a list that looks like this:
>>
>> class BufferIO(list):
>>     write = list.append
>>
>>     def getvalue(self):
>>         return ''.join(self)
>
> yeah here's ours:
>
> class FastEncodingBuffer(object):
>
>    def __init__(self, encoding=None, errors='strict', unicode=False):
>        self.data = []
>        # ...
>        self.write = self.data.append
>
> seriously, its like a mind meld :)

I think once you use the basic idea of turning your templates into
Python code executed at runtime without any parsing steps, the results
have to look similar. The "there's should only be one way to do it"
mantra of Python helps a lot into coming up with the exact same
results.

Is there any mailing list that would be a good place to discuss Python
templating languages in general? I think Malthe Borch and Mike Solomon
might be interested as well.

I'll certainly have a look at the Mako source code :)

Hanno

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com
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