Content-Length: 284242 | pFad | http://github.com/go-python/gpython/commit/acd458b80be6badfefd1922d4a189f696f7be65e

86 py: int() default to decimal · go-python/gpython@acd458b · GitHub
Skip to content

Commit acd458b

Browse files
wetorncw
authored andcommitted
py: int() default to decimal
1 parent 652daef commit acd458b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

py/int.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func (o Int) Type() *Type {
5555
func IntNew(metatype *Type, args Tuple, kwargs StringDict) (Object, error) {
5656
var xObj Object = Int(0)
5757
var baseObj Object
58-
base := 0
58+
base := 10
5959
err := ParseTupleAndKeywords(args, kwargs, "|OO:int", []string{"x", "base"}, &xObj, &baseObj)
6060
if err != nil {
6161
return nil, err

py/tests/int.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103

104104
doc="sigils"
105105
assert int("7") == 7
106+
assert int("07") == 7
106107
assert int("07", 10) == 7
107108

108109
assert int("F", 16) == 15

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/go-python/gpython/commit/acd458b80be6badfefd1922d4a189f696f7be65e

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy