[Zope] tino's <dtml-in> improvements Why, DC?

Jim Fulton jim@digicool.com
Fri, 23 Mar 2001 14:07:23 -0500


Peter Bengtsson wrote:
> 
> > At http://www.zope.org/Members/tino/in_tag_patch, member tino has a
> > patched version of dtml-in that solves two problems:
> >
> <snip>
> > Has anyone updated this for 2.3 -number vars?
> > Can we get consensus that this should join the Zope core?
> 
> I think that being able to use sequence_number instead of sequence-number
> and others sounds interesting.

Me too.

> In the last year I have seen many people complaining about this with DC
> doing anything about it.
> Makes you think!

About what? 

> DC are pretty skilled py-engineers. If they don't want to use sequence-item,
> then with what reason??
> So, DC, people what's so cool about sequence-item that you can't get with
> sequence_item?? What's the underlying reasoning here?

The argument for sequence-item is not as strong as it one was, 
but it is still valid. In any case, changing this risks breaking
existing working code. 

The original rational goes as follows:

The basic fear is that someone might have a user-defined variable, 
such as a Python attribute or a SQL column name that conflicted
with a generated name. So we (I :) generated names that could not
conflict with user-defined names (at the time). At the time, 
we didn't allow Python expressions in DTML and, at the time, 
we didn't allow user-defined names that weren't legal Python
names, so the generated names were safe from conflicts.

I agree that _['sequence-item'] is painfull. My problem with
allowing names like sequence_item as aliases is not just
that they may cause name conflicts in new DTML, but that they
may cause existing DTML code to break. One could argue that the
chance of this is low, but I think that a user-defined name like
'sequence_number' is not that unlikely.

I think that there are better ways to solve this problem than
providing the aliases, but DC has, admittedly been slow to act.

I like the prefix part of tino's patch. It makes the alias part of the 
patch unnecessary (assuming that the prefix was applied to 
generated names like count-xxx, as in prefix_count_xxx).

FWIW, I'm very much for adding the prefix feature, but am opposed 
to the alias for fear of breaking old DTML code.

Jim

--
Jim Fulton           mailto:jim@digicool.com   Python Powered!        
Technical Director   (888) 344-4332            http://www.python.org  
Digital Creations    http://www.digicool.com   http://www.zope.org