<br><br><div><span class="gmail_quote">On 4/12/07, <b class="gmail_sendername">Giovannetti, Mark</b> &lt;<a href="mailto:giovanne@nrcan.gc.ca">giovanne@nrcan.gc.ca</a>&gt; 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&#39;s having a splendid day/evening/whatever.<br><br>I&#39;ve encountered a strange error.&nbsp;&nbsp;I have two chunks<br>of nearly identical code below.&nbsp;&nbsp;The only difference<br>is the first &quot;if&quot; statement.&nbsp;&nbsp;One has:
<br><br>&nbsp;&nbsp;&nbsp;&nbsp;if context:<br><br>the other has:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;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>&quot;if context&quot; is equal to &quot;if len(context) &gt; 0&quot;.&nbsp; So even if context is not None, it still may be False if the container does not contain any elements.
<br><br><br><br>