消息 [75767]
The latest patch from Victor looks good. A few comments:
(1) the number of bits should be computed first directly using C
arithmetic, and only recomputed using PyLong arithmetic if the C
computations overflow. For one thing, overflow is going to be very rare
in practice; for another, in the sort of applications that use
.numbits(), speed of numbits() is often critical.
(2) Just as a matter of style, I think "if (x == NULL)" is preferable
to "if (!x)". At any rate, the former style is much more common in
Python source.
(3) the reference counting all looks good.
(4) I quite like the idea of having numbits be a property rather than a
method---might still be worth considering? |
|
| 日期 |
用户 |
动作 |
参数 |
| 2008-11-11 23:00:17 | mark.dickinson | 修改 | recipients:
+ mark.dickinson, loewis, rhettinger, terry.reedy, vstinner, fredrikj |
| 2008-11-11 23:00:17 | mark.dickinson | 修改 | messageid: <1226444417.18.0.329650799396.issue3439@psf.upfronthosting.co.za> |
| 2008-11-11 23:00:13 | mark.dickinson | 链接 | issue3439 messages |
| 2008-11-11 23:00:12 | mark.dickinson | 创建 | |
|