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 [email protected] http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
