durusmail: qp: Re: Another Proposed Template Notation
Another Proposed Template Notation
2007-11-01
Re: Another Proposed Template Notation
2007-11-01
2007-11-01
2007-11-01
2007-11-01
Re: Another Proposed Template Notation
2007-11-02
2007-11-02
2007-11-02
2007-11-02
2007-11-02
Re: Another Proposed Template Notation
Michael Watkins
2007-11-02
* mario ruggier wrote on [2007-11-01 23:27:49 +0100]:
> def xml:render_something ():
> def str:render_something ():

I can see the logic in this but prefer the reverse, as David had
proposed. I'd rather let my eyes take in the purpose of a callable
first rather than the annotation declaring it a template. I think
you lose other Pythonistic notions in that representation as well -
for instance, underscored names just don't stand out as much:

    def xml:_q_index(self):

vs what we are used to, not just in QP[|Y]

    def _q_index [html] (self):
or
    def _q_index [xml] (self):
or
    def _q_index:xml(self):

So, if the annotation syntax is to change,

    def render_form:xml():

gets +1 from me. Compact and clean.

Although truth be told I've grown accustomed to

    def render_form [html] ():

.... and find that ' [html] ' (or xml|str) makes template callables
stand out nicely. I don't think that aesthetic difference will
amount to much in the end though. If it does, for users of
customizable editors at least, a syntax file mod may be in order.
reply