[issue14376] sys.exit documents argument as "integer" but actually requires "subtype of int"

Ryan Gonzalez report at bugs.python.org
Fri Apr 24 01:17:52 CEST 2015


Ryan Gonzalez added the comment:

>
> "errors should not pass silently"
>
> The "fix" makes the problem worse.
>
> Why would anyone want to pass a long integer to exit?
>
> I bet the user who discovered this problem had something like 0L or 1L
> coming from a lazily written C extension.

Or the person is using a Python code generator that makes everything a long
for portability reasons! Hy does this.

int and long are supposed to be indistinguishable. Quote by Guido from the
time when I figured out the re module's group function doesn't take longs:

...but any place where an int is accepted but a long is not, is a bug. The
language has been on a long trip to making the two types interchangeable
and this seems one of the last remnants.

Notice the word *interchangeable*.

Also, I find that the current behavior is even more confusing.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14376>
_______________________________________


More information about the Python-bugs-list mailing list