-
-
Notifications
You must be signed in to change notification settings - Fork 661
Closed
Description
It was observed in
this sage-support thread that Python new-style format specifiers for Sage Integers don't work. The solution is easy: Equip Integer with a __format__
method that simply converts the Sage Integer to a Python int and then calls the __format__
method on that. Given that converting a GMP int to a Python int should be much cheaper than converting either to a string, I don't expect much of a performance penalty, and implementing the whole Format mini-language again seems a waste of effort.
Component: basic arithmetic
Author: Nils Bruin
Reviewer: Mike Hansen
Merged: sage-5.0.beta12
Issue created by migration from https://trac.sagemath.org/ticket/12788