A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-November/083540.html below:

[Python-Dev] n.numbits: method or property?

[Python-Dev] n.numbits: method or property? [Python-Dev] n.numbits: method or property?Antoine Pitrou solipsis at pitrou.net
Wed Nov 12 16:15:45 CET 2008
Greg Ewing <greg.ewing <at> canterbury.ac.nz> writes:
> 
> Terry Reedy wrote:
> 
> > Math is pretty much float, not int functions.
> 
> Also, it's supposed to be confining itself to
> wrapping the C math library.

Too late, because we now have a math.factorial() function.

As for numbits, I think it should be a method, because while it's very fast for
the current implementation of longs, it could be longer to calculate for a long
implementation using something other than a power-of-2 base.

Having it as a method may also be more consistent with a hypothetical popcount()
method.

Regards

Antoine.


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4