Skip to content
Snippets Groups Projects
Commit 05f260d5 authored by alandonovan's avatar alandonovan Committed by GitHub
Browse files

skylark: range(...) no longer materializes the sequence as a list (#25)

* skylark: range(...) no longer materializes the sequence as a list

Skylark now follows the Python3, not Python2, semantics for range.

Also: fix an off-by-one error.

* range: allow membership tests 'x in range(n)'

Change-Id: I0dffe70510f723c00da4153bcc0a17478cceb986

* range: allow floating point numbers for x in 'x in range(y)'

- use ConvertToInt to convert x to an integer.
- change ConvertToInt not to accept a bool.  This affects string interpolation.
  e.g. "%d" % True now (correctly) results in an error.
- rename ConvertToInt to NumberToInt

Change-Id: Ie9e9d40d993c227b834bb720e5dbe3714032836a

* range: doc tweaks

Change-Id: I3f242d38a5969fa228167b72be6cb78aa4677eb6
parent 5ce1e423
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment