[ZPT] [Weakness] "tal:repeat" not yet right

Evan Simpson evan@zope.com
Wed, 26 Sep 2001 22:20:45 -0400


Richard Jones wrote:

> It would appear this was overstated, and I apologise. We will have a problem 
> with anyone we've shipped our product to - we don't control the PT code, and 
> there's a chance it'll break. I think we can cover ourselves with enough 
> warning notices with the upgrade though.
 
Hmm.  I know that you're not the only one with production code out there, and I

*really* don't want to break compatibility.   On the other hand, there seems to

be substantial willingness in the ZPT community to endure more changes 
of this magnitude, and this is a bad wart.

Perhaps we can emulate Python, here.  Guido & gang solved this problem 
by introducing their warning and "import from __future__" statements. 
In one version, new behavior is available if you "import" it.  In the 
next version, you get warnings if you have code that would break. 
Finally a version makes the new behavior the default, and the "import 
from __future__" can be removed, although it is safe to leave it in.


One way to proceed is to define some kind of behavior marker (a 
processing instuction, perhaps?) that changes the order of operations. 
Then, release a version that issues a warning for any template that uses 
tal:condition but doesn't have the marker.  Finally, change the order of 
operations, turn off the warnings, and auto-drop the marker when a page 
is edited.

Thoughts?

Cheers,

Evan @ Zope