-
-
Notifications
You must be signed in to change notification settings - Fork 656
Closed
Milestone
Description
Python has int.bit_length()
, but Sage has Integer.nbits()
.
In this patch, we add Integer.bit_length()
for compatibility with int
.
Among other things, this change should make it easier to switch from Python to Sage mid-development, which currently requires replacing all calls to .bit_length()
or adding casts to int
.
This helps with
- Meta-ticket: improve compatibility with the Python library and Python packages #29728: Meta-ticket: improve compatibility with the Python library and Python packages
Component: basic arithmetic
Author: Lorenz Panny
Branch: fb8f165
Reviewer: Frédéric Chapoton
Issue created by migration from https://trac.sagemath.org/ticket/33676