8000 builtins: slightly improve print() · go-python/gpython@bf490cc · GitHub
[go: up one dir, main page]

Skip to content

Commit bf490cc

Browse files
committed
builtins: slightly improve print()
1 parent 833d4da commit bf490cc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

builtin/builtin.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,14 @@ end: string appended after the last value, default a newline.
170170
flush: whether to forcibly flush the stream.`
171171

172172
func builtin_print(self py.Object, args py.Tuple, kwargs py.StringDict) (py.Object, error) {
173-
fmt.Printf("print %v, %v, %v\n", self, args, kwargs)
173+
// FIXME ignoring file, sep, end and flush
174+
for i, v := range args {
175+
fmt.Printf("%v", v)
176+
if i != len(args)-1 {
177+
fmt.Print(" ")
178+
}
179+
}
180+
fmt.Print("\n")
174181
return py.None, nil
175182
}
176183

0 commit comments

Comments
 (0)
0