Issue 28998: Unifying Long Integers and Integers in 2.7 (original) (raw)
Since implementing PEP 237 (Unifying Long Integers and Integers) in Python 2.4 int and long instances became interchangeable. Virtually any function that needs an integer, accepts both int and long. But there are few places where only int is accepted. Since it is easy unintentionally convert int to long (add and subtract large int, or add 0L), this can lead to subtle errors in rare circumstances.
Proposed patch makes few places that accepted only int accepting long too. This mainly is changing isinstance(x, int) to isinstance(x, (int, long)).