[Zope] Python nasty :S
Chris Withers
chrisw@nipltd.com
Tue, 01 Aug 2000 23:51:43 +0100
Flame me if you want, but this one really got me bad so I thought I'd
make others aware...
cheers,
Chris
ChrisW's post to the Python Bug List:
> I have something equivalent to this in my code:
>
> mylist = ['x','y'
> 'z']
>
> (the real code has much longer contents, hence the line break ;-)
>
> I think this should throw a parse error 'cos there's a missing comma.
>
> What actually happens is it ends up as:
>
> mylist = ['x','yz']
>
> which is _really_ non-intuitive. I spent a good few hours trying to find the source
> of an exception in the Squishdot product for Zope until I noticed this.
>
> I note that:
> mystring = 'x''y'
> is also legal, which I suspect is the roundabout source of this problem.
>
> Sure that should raise an error and only the following should give the result that that does:
> mystring = 'x'+'y'
>
> cheers,
>
> Chris