<span>Thanks for all that. Surprised it got so complicated.<br><br>Wondering if you guys ever sleep!! :-)<br><br>Davy<br></span><br><div class="gmail_quote">On Sun, Apr 6, 2008 at 12:24 AM, Curt Hagenlocher &lt;<a href="mailto:curt@hagenlocher.org">curt@hagenlocher.org</a>&gt; 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">On Sat, Apr 5, 2008 at 10:21 AM, Michael Foord<br>
&lt;<a href="mailto:fuzzyman@voidspace.org.uk">fuzzyman@voidspace.org.uk</a>&gt; wrote:<br>
&gt;<br>
&gt; As bool inherits from int, calling &#39;sys.exit&#39; with False ought to be<br>
&gt; exactly the equivalent of calling it with 0. (False == 0, True == 1).<br>
<br>
</div>SystemExitException.GetExitCode calls TypeCache.Int32.IsInstanceOfType<br>
with the argument to the exit function, and this function returns<br>
false when the type of the argument is System.Boolean.<br>
<br>
In other words, this discrepancy happens because<br>
TypeCache.Int32.IsInstanceOfType(false) == false<br>
TypeCache.Int32.IsInstanceOfType(4) == true<br>
<br>
Interestingly, a user-defined type that derives from &quot;int&quot; produces<br>
the correct response.<br>
<font color="#888888"><br>
--<br>
Curt Hagenlocher<br>
<a href="mailto:curt@hagenlocher.org">curt@hagenlocher.org</a><br>
</font><div><div></div><div class="Wj3C7c">_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Davy Mitchell<br>Blog - <a href="http://www.latedecember.co.uk/sites/personal/davy/">http://www.latedecember.co.uk/sites/personal/davy/</a><br>Twitter - <a href="http://twitter.com/daftspaniel">http://twitter.com/daftspaniel</a><br>
Skype - daftspaniel <a href="http://needgod.com">http://needgod.com</a>