whatever[0:2] will yield THREE characters, so my "by " is correct and "by" will fail every time :))<br>Victor<br><br><div class="gmail_quote">On Dec 14, 2007 12:06 PM, Derek Broughton <<a href="mailto:derek@pointerstop.ca">
derek@pointerstop.ca</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">Encolpe Degoute wrote:<br><br>> Derek Broughton a écrit :
<br>>> Victor Subervi wrote:<br>>><br>>>> Hi;<br>>>> Why can't I do this?<br>>>><br>>>>>>> author = "By Juan Garcia"<br>>>>>>> if author[0:2] == "by " | "By " | "BY":
<br>>>> ...   author = author[3:]<br>>>> ...<br>>>> Traceback (most recent call last):<br>>>>   File "<stdin>", line 1, in ?<br>>>> TypeError: unsupported operand type(s) for |: 'str' and 'str'
<br>>><br>>> because | is unsupported, and it doesn't make sense that way.<br>>><br>>> Wouldn't:<br>>>  if author[0:2].lower() == "by":<br>>> make more sense (btw, that trailing space in your "by " would have made
<br>>> it fail anyway).<br>><br>> Are you sure of this ?<br><br></div>Yes, because I executed it in python...<br><br>--<br><font color="#888888">derek<br></font><div><div></div><div class="Wj3C7c"><br><br>-------------------------------------------------------------------------
<br>SF.Net email is sponsored by:<br>Check out the new SourceForge.net Marketplace.<br>It's the best place to buy or sell services<br>for just about anything Open Source.<br><a href="http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace" target="_blank">
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace</a><br>_______________________________________________<br>Plone-Users mailing list<br><a href="mailto:Plone-Users@lists.sourceforge.net">Plone-Users@lists.sourceforge.net
</a><br><a href="https://lists.sourceforge.net/lists/listinfo/plone-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/plone-users</a><br></div></div></blockquote></div><br>