Thanks for all that. Surprised it got so complicated.

Wondering if you guys ever sleep!! :-)

Davy

On Sun, Apr 6, 2008 at 12:24 AM, Curt Hagenlocher <[EMAIL PROTECTED]>
wrote:

> On Sat, Apr 5, 2008 at 10:21 AM, Michael Foord
> <[EMAIL PROTECTED]> wrote:
> >
> > As bool inherits from int, calling 'sys.exit' with False ought to be
> > exactly the equivalent of calling it with 0. (False == 0, True == 1).
>
> SystemExitException.GetExitCode calls TypeCache.Int32.IsInstanceOfType
> with the argument to the exit function, and this function returns
> false when the type of the argument is System.Boolean.
>
> In other words, this discrepancy happens because
> TypeCache.Int32.IsInstanceOfType(false) == false
> TypeCache.Int32.IsInstanceOfType(4) == true
>
> Interestingly, a user-defined type that derives from "int" produces
> the correct response.
>
> --
> Curt Hagenlocher
> [EMAIL PROTECTED]
> _______________________________________________
> Users mailing list
> Users@lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>



-- 
Davy Mitchell
Blog - http://www.latedecember.co.uk/sites/personal/davy/
Twitter - http://twitter.com/daftspaniel
Skype - daftspaniel http://needgod.com
_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to