-- -*- M2-comint -*- hash: 10275422397843158422

i1 : fractions = import "fractions"

o1 = <module 'fractions' from '/usr/lib/python3.14/fractions.py'>

o1 : PythonObject of class module

i2 : x = fractions@@"Fraction"(2, 3)

o2 = 2/3

o2 : PythonObject of class fractions.Fraction

i3 : value x

o3 = .6666666666666666

o3 : RR (of precision 53)

i4 : toQQ = x -> value x@@"numerator" / value x@@"denominator";

i5 : addPyToM2Function("fractions.Fraction", toQQ, "Fraction -> QQ");

i6 : value x

     2
o6 = -
     3

o6 : QQ

i7 : hooks value

o7 = {0 => (value, PythonObject, Strategy => unknown -> PythonObject)                    }
     {1 => (value, PythonObject, Strategy => collections.abc.Callable -> FunctionClosure)}
     {2 => (value, PythonObject, Strategy => collections.abc.Mapping -> HashTable)       }
     {3 => (value, PythonObject, Strategy => collections.abc.Set -> Set)                 }
     {4 => (value, PythonObject, Strategy => collections.abc.Sequence -> Sequence)       }
     {5 => (value, PythonObject, Strategy => collections.abc.MutableSequence -> List)    }
     {6 => (value, PythonObject, Strategy => str -> String)                              }
     {7 => (value, PythonObject, Strategy => numbers.Complex -> CC)                      }
     {8 => (value, PythonObject, Strategy => numbers.Real -> RR)                         }
     {9 => (value, PythonObject, Strategy => numbers.Integral -> ZZ)                     }
     {10 => (value, PythonObject, Strategy => bool -> Boolean)                           }
     {11 => (value, PythonObject, Strategy => Fraction -> QQ)                            }

o7 : NumberedVerticalList

i8 : 
