[issue3439] create a numbits() method for int and long types
report at bugs.python.org
Tue Oct 14 17:13:41 CEST 2008
STINNER Victor <victor.stinner at haypocalc.com> added the comment:
> Accidentally removed the following message from Victor Stinner
> Is there any good reason to make this a property?
Since numbits() cost is O(n) with n: number of digits. I prefer a
method than a property because, IMHO, reading a property should be
O(1) (*read* an attribute is different than *compute* a value).
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list