[ZPT] Re: Add 'parity' to repeat?

Charlie Clark charlie at begeistert.org
Thu Aug 28 23:15:51 EDT 2003


On 2003-08-28 at 14:07:21 [+0200], you wrote:
> 
> This isn't about the core of ZPT, it's about ZTUtils.Iterator.Iterator. 
>   That class contains utilities for iteration.  Most people only use the 
> "index" attribute, but Iterator also has several other utilities like 
> even(), odd(), number(), letter(), Roman(), etc.  parity() is a natural 
> fit.
> 
> Evan's sinister secret plot to spread Plone to every server, desktop, 
> handheld device, and human implant will not be aided by parity().

Sorry. I wasn't intending to be contentious regarding Plone. Evan just 
cited the prevalence in Plone being the drive being looking into this and I 
guess I've become quite conservative about features since I started with 
Python. I don't need the feature directly so I was trying to work out what 
was behind it and how something similar might be done which I could also 
use. I really like ZPT and the recent discussion re: if/else has shown how 
much thought has been done before anything is implemented.

While it might be a natrual fit that is in itself no justification. If 
parity() is added, then even() and odd() should be deprecated. However, I 
still prefer my own more declarative and explicit suggestion. I've no idea 
how this would work with iterators but my page design brain bit feels quite 
happy with this.

Charlie



More information about the ZPT mailing list