Zope/DTML Infuriating...

Jens jens at aggergren.dk
Tue Apr 29 08:19:32 EDT 2008


On Apr 29, 1:59 pm, Marco Mariani <ma... at sferacarta.com> wrote:
> Jens wrote:
> > I've the checked that i'm referring to the variables correctly, so the
> > only explanation i can come up with, is that '+' doesn't result in a
> > string concatenation (with implicit typecast to string of the integer
> > variable(this is a interpreted language after all)).
>
> No, sorry. You really need to read the python tutorial at the very least.
> You might have wrong assumptions from previous PHP experiences.
>
>  >>> 'x'+4
> Traceback (most recent call last):
>    File "<stdin>", line 1, in <module>
> TypeError: cannot concatenate 'str' and 'int' objects
>  >
... and the non snobby answer would have been:

...  <dtml-var expr="_['prefix'] + str(_['sequence-item'])">



More information about the Python-list mailing list