From 9ecc919bf0445710266b01918bee0e2af5cbd749 Mon Sep 17 00:00:00 2001 From: wetor Date: Sat, 18 Mar 2023 14:19:46 +0800 Subject: [PATCH] py: int() default to decimal --- py/int.go | 2 +- py/tests/int.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/py/int.go b/py/int.go index dde6993e..919c28aa 100644 --- a/py/int.go +++ b/py/int.go @@ -55,7 +55,7 @@ func (o Int) Type() *Type { func IntNew(metatype *Type, args Tuple, kwargs StringDict) (Object, error) { var xObj Object = Int(0) var baseObj Object - base := 0 + base := 10 err := ParseTupleAndKeywords(args, kwargs, "|OO:int", []string{"x", "base"}, &xObj, &baseObj) if err != nil { return nil, err diff --git a/py/tests/int.py b/py/tests/int.py index 758829ab..79356b3c 100644 --- a/py/tests/int.py +++ b/py/tests/int.py @@ -103,6 +103,7 @@ doc="sigils" assert int("7") == 7 +assert int("07") == 7 assert int("07", 10) == 7 assert int("F", 16) == 15