<br><br><div><span class="gmail_quote">On 4/12/07, <b class="gmail_sendername">Giovannetti, Mark</b> <<a href="mailto:giovanne@nrcan.gc.ca">giovanne@nrcan.gc.ca</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi list,<br><br>Hope everyone's having a splendid day/evening/whatever.<br><br>I've encountered a strange error. I have two chunks<br>of nearly identical code below. The only difference<br>is the first "if" statement. One has:
<br><br> if context:<br><br>the other has:<br><br> if context is not None<br><br>The first fails to be true even if context is not None.<br>This can be seen by the output from the logs showing the<br>context variable as:
<br></blockquote></div><br>Possibly a context is a container-like object.<br>For containers operation<br>"if context" is equal to "if len(context) > 0". So even if context is not None, it still may be False if the container does not contain any elements.
<br><br><br><br>