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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy