This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
| Author | terry.reedy |
|---|---|
| Recipients | terry.reedy |
| Date | 2008年03月19日.04:45:56 |
| SpamBayes Score | 0.27059957 |
| Marked as misclassified | No |
| Message-id | <1205901957.73.0.828809494878.issue2417@psf.upfronthosting.co.za> |
| In-reply-to |
| Content | |
|---|---|
Python 3.0a3 (r30a3:61161, Mar 1 2008, 22:51:17) [MSC v.1500 32 bit (Intel)] on win32 >>> a,b=1,1//1 >>> a is b False IDLE 3.0a3 >>> a,b=1,1//1 >>> a is b True ditto for 2.5.2 interpreter On c.l.p, Duncan Booth wrote I've had a look to see why this happens: long division (and in Python 3 all integers are longs) allocates a new long to hold the result of the division so it will never use one of the preallocated 'small int' values. That maybe explains the change from 2.5 but not the difference from IDLE. More important, the small int checks are present with the other operations: >>> 1*1 is 1 True >>> 1+1 is 2 True >>> 1-1 is 0 True >>> 1**1 is 1 True so the omission with // is plausibly a bug. |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2008年03月19日 04:45:57 | terry.reedy | set | spambayes_score: 0.2706 -> 0.27059957 recipients: + terry.reedy |
| 2008年03月19日 04:45:57 | terry.reedy | set | spambayes_score: 0.2706 -> 0.2706 messageid: <1205901957.73.0.828809494878.issue2417@psf.upfronthosting.co.za> |
| 2008年03月19日 04:45:56 | terry.reedy | link | issue2417 messages |
| 2008年03月19日 04:45:56 | terry.reedy | create | |