That was done for int.bit_length()
and int.bit_count()
. There’s no consistent “logic” to this. At heart, Python is not, and does not aspire to be, a purely OO language. There are centuries of literature and prior art that “spell” the high-use integer functions (like gcd()
, factorial()
, etc) in some form of functional notation. object.method()
notation is a new-fangled thing and not necessarily an improvement for usability .
3 Likes