[New-bugs-announce] [issue28998] Unifying Long Integers and Integers in 2.7

Serhiy Storchaka report at bugs.python.org
Sat Dec 17 04:37:38 EST 2016


New submission from Serhiy Storchaka:

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)).

----------
components: Extension Modules, Library (Lib)
messages: 283479
nosy: benjamin.peterson, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Unifying Long Integers and Integers in 2.7
versions: Python 2.7

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


More information about the New-bugs-announce mailing list