Pythonic way of web-programming

Alex Martelli aleax at aleax.it
Thu Apr 17 02:09:03 EDT 2003


On Wednesday 16 April 2003 10:58 pm, Ian Bicking wrote:
   ...
> For a difference in interface, Cheetah takes a list of namespaces that
> get folded together.  I haven't looked at preppy, but let's say it takes
> a dictionary or a single namespace.  That's a different interface, but
> it can be turned into one interface, and then both templating languages
> will benefit.

Ah, I see your point, now -- you're talking about the way a templating
operation is initiated _from the Python side_ -- Cheetah's class Template
constructor (returning a class instance x that's then normally expanded
by str(x)), preppy's getModule function (returning a module object m that's
then normally expanded by calling m.run with a dict and output specs), &c.

Yes, I agree, it would definitely be possible to merge these interfaces
into a single one, so that Python code that needs templating can most
easily switch between using different templating packages -- at least
as long as the templating model is somewhat abstractly compatible,
enough commonality should be easily identifiable for this purpose,
while leaving each templating package the choice of what templating
little-language to implement, which is clearly the major differentiatior
(while in the DB-API analogy, the difference between SQL dialects is
hopefully minor in comparison).


Thanks for clarifying,

Alex






More information about the Python-list mailing list