Content-Length: 269097 | pFad | http://github.com/go-python/gpython/commit/bf490cca095d1389eea6a61ceb54daa73247d870

C4 builtins: slightly improve print() · go-python/gpython@bf490cc · GitHub
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)








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/bf490cca095d1389eea6a61ceb54daa73247d870

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy