Skip to content

Commit

Permalink
skylark: update doc: String is not iterable (google#111)
Browse files Browse the repository at this point in the history
Fixes issue 44
  • Loading branch information
adonovan authored Jun 25, 2018
1 parent f5fb4d2 commit a21eb0f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions value.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,10 @@ func (x Float) Mod(y Float) Float { return Float(math.Mod(float64(x), float64(y)

// String is the type of a Skylark string.
//
// A String is an immutable sequence of bytes. Strings are iterable;
// iteration over a string yields each of its 1-byte substrings in order.
// A String encapsulates an an immutable sequence of bytes,
// but strings are not directly iterable. Instead, iterate
// over the result of calling one of these four methods:
// codepoints, codepoint_ords, elems, elem_ords.
type String string

func (s String) String() string { return strconv.Quote(string(s)) }
Expand Down

0 comments on commit a21eb0f

Please sign in to comment.