Message283479
| Author |
serhiy.storchaka |
| Recipients |
benjamin.peterson, serhiy.storchaka |
| Date |
2016年12月17日.09:37:38 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1481967458.92.0.739722865425.issue28998@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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)). |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2016年12月17日 09:37:38 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, benjamin.peterson |
| 2016年12月17日 09:37:38 | serhiy.storchaka | set | messageid: <1481967458.92.0.739722865425.issue28998@psf.upfronthosting.co.za> |
| 2016年12月17日 09:37:38 | serhiy.storchaka | link | issue28998 messages |
| 2016年12月17日 09:37:38 | serhiy.storchaka | create |
|