File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -406,12 +406,12 @@ public int quiet {
406406
407407 #endregion
408408
409- // These values are based on the .NET 2 BigInteger in Microsoft.Scripting.Math
410- public static longinfo long_info = new longinfo ( 32 , 4 ) ;
409+ // These values are based on the .NET BigInteger in System.Numerics.BigInteger
410+ public static intinfo int_info = new intinfo ( 32 , 4 ) ;
411411
412- [ PythonType ( "long_info " ) , PythonHidden ]
413- public class longinfo : PythonTuple {
414- internal longinfo ( int bits_per_digit , int sizeof_digit )
412+ [ PythonType ( "int_info " ) , PythonHidden ]
413+ public class intinfo : PythonTuple {
414+ internal intinfo ( int bits_per_digit , int sizeof_digit )
415415 : base ( new object [ ] { bits_per_digit , sizeof_digit } ) {
416416
417417 this . bits_per_digit = bits_per_digit ;
@@ -426,7 +426,7 @@ internal longinfo(int bits_per_digit, int sizeof_digit)
426426 public const int n_unnamed_fields = 0 ;
427427
428428 public override string __repr__ ( CodeContext context ) {
429- return $ "sys.long_info (bits_per_digit={ bits_per_digit } , sizeof_digit={ sizeof_digit } )";
429+ return $ "sys.int_info (bits_per_digit={ bits_per_digit } , sizeof_digit={ sizeof_digit } )";
430430 }
431431 }
432432
Original file line number Diff line number Diff line change @@ -406,7 +406,13 @@ def test_attributes(self):
406406 self .assertEqual (len (sys .float_info ), 11 )
407407 self .assertEqual (sys .float_info .radix , 2 )
408408 self .assertEqual (len (sys .int_info ), 2 )
409- self .assertTrue (sys .int_info .bits_per_digit % 5 == 0 )
409+
410+ # ironpython-specific integer representation https://github.com/IronLanguages/ironpython3/issues/974
411+ if sys .implementation .name == "ironpython" :
412+ self .assertTrue (sys .int_info .bits_per_digit == 32 )
413+ else :
414+ self .assertTrue (sys .int_info .bits_per_digit % 5 == 0 )
415+
410416 self .assertTrue (sys .int_info .sizeof_digit >= 1 )
411417 self .assertEqual (type (sys .int_info .bits_per_digit ), int )
412418 self .assertEqual (type (sys .int_info .sizeof_digit ), int )
You can’t perform that action at this time.
0 commit comments