@@ -745,7 +745,7 @@ impl PyInt {
745745 multiply : Some ( |a, b, vm| PyInt :: number_op ( a, b, |a, b, _vm| a * b, vm) ) ,
746746 remainder : Some ( |a, b, vm| PyInt :: number_op ( a, b, inner_mod, vm) ) ,
747747 divmod : Some ( |a, b, vm| PyInt :: number_op ( a, b, inner_divmod, vm) ) ,
748- power : Some ( |a, b, vm| PyInt :: number_op ( a, b, inner_pow, vm) ) ,
748+ power : Some ( |a, b, _c , vm| PyInt :: number_op ( a, b, inner_pow, vm) ) , // TODO(snowapril) : use modulo
749749 negative : Some ( |num, vm| ( & PyInt :: number_downcast ( num) . value ) . neg ( ) . to_pyresult ( vm) ) ,
750750 positive : Some ( |num, vm| Ok ( PyInt :: number_downcast_exact ( num, vm) . into ( ) ) ) ,
751751 absolute : Some ( |num, vm| PyInt :: number_downcast ( num) . value . abs ( ) . to_pyresult ( vm) ) ,
@@ -756,14 +756,14 @@ impl PyInt {
756756 and : Some ( |a, b, vm| PyInt :: number_op ( a, b, |a, b, _vm| a & b, vm) ) ,
757757 xor : Some ( |a, b, vm| PyInt :: number_op ( a, b, |a, b, _vm| a ^ b, vm) ) ,
758758 or : Some ( |a, b, vm| PyInt :: number_op ( a, b, |a, b, _vm| a | b, vm) ) ,
759- int : Some ( |num, vm| Ok ( PyInt :: number_downcast_exact ( num, vm) ) ) ,
759+ int : Some ( |num, vm| PyInt :: number_downcast_exact ( num, vm) . to_pyresult ( vm ) ) ,
760760 float : Some ( |num, vm| {
761761 let zelf = PyInt :: number_downcast ( num) ;
762- try_to_float ( & zelf. value , vm) . map ( |x| vm. ctx . new_float ( x) )
762+ try_to_float ( & zelf. value , vm) . map ( |x| vm. ctx . new_float ( x) . into_pyobject ( vm ) )
763763 } ) ,
764764 floor_divide : Some ( |a, b, vm| PyInt :: number_op ( a, b, inner_floordiv, vm) ) ,
765765 true_divide : Some ( |a, b, vm| PyInt :: number_op ( a, b, inner_truediv, vm) ) ,
766- index : Some ( |num, vm| Ok ( PyInt :: number_downcast_exact ( num, vm) ) ) ,
766+ index : Some ( |num, vm| PyInt :: number_downcast_exact ( num, vm) . to_pyresult ( vm ) ) ,
767767 ..PyNumberMethods :: NOT_IMPLEMENTED
768768 } ;
769769
0 commit comments