[Zope-CMF] Re: CVS: Products/CMFDefault/skins/zpt_content -
content_status_history.pt:1.4 transition_form.pt:1.3
Jean-Marc Orliaguet
jmo at ita.chalmers.se
Tue Aug 3 14:55:04 EDT 2004
Tres Seaver wrote:
> Paul Winkler wrote:
>
>> On Tue, Aug 03, 2004 at 10:49:05AM -0400, Tres Seaver wrote:
>>
>>> Yvo Schubbe wrote:
>>>
>>>> Update of /cvs-repository/Products/CMFDefault/skins/zpt_content
>>>> In directory
>>>> cvs.zope.org:/tmp/cvs-serv27889/CMFDefault/skins/zpt_content
>>>>
>>>> Modified Files:
>>>> content_status_history.pt transition_form.pt Log Message:
>>>> - replaced reverseList by [::-1] and marked reverseList as deprecated
>>>
>>>
>>> Oooh! That is a brilliant hack! I love it.
>>
>>
>>
>> It's a neat trick, but OTOH, it's kinda obscure, at least to CMF
>> users who are less well versed in python. It strikes me as a bit
>> (dare I say it) perlish.
>
>
> Given that it allows me to get the list reversed in an expression,
> without the need for a do-nothing-else PythonScript, I'd still call it
> a win. Vive l'idiom!
>
> Tres.
how big is the list?
list.reverse() is almost almost twice as fast as [::-1] and seems to be
better optimized in terms of RAM usage, but of course if there are only
3 items in the list, you are right.
and [::-1] doesn't work with python2.1, but that's OK I suppose?
cheers /JM
More information about the Zope-CMF
mailing list