Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
print should use __str__ or __repr__ when available
  • Loading branch information
raff committed Sep 7, 2018
commit a7252c0a1a8ecc9beeb7a40a0d0fc2b790ebb0c3
5 changes: 5 additions & 0 deletions builtin/builtin.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ func builtin_print(self py.Object, args py.Tuple, kwargs py.StringDict) (py.Obje
end := endObj.(py.String)
// FIXME ignoring file and flush
for i, v := range args {
v, err := py.Str(v)
if err != nil {
return nil, err
}

fmt.Printf("%v", v)
if i != len(args)-1 {
fmt.Print(sep)
Expand Down