Ticket #208 (closed defect: fixed)
empty for-int-in-range loop doesn't behave as in Python
| Reported by: | scoder | Owned by: | robertwb |
|---|---|---|---|
| Priority: | minor | Milestone: | 0.11.1 |
| Component: | Python Semantics | Keywords: | |
| Cc: |
Description
When optimised into a C loop, the for-in-range loop over an empty range still changes the value of the loop variable. In Python, this is not the case.
def go_py_empty():
i = 20
for i in range(4,0):
print u"Spam!"
return i # == 20
def go_c_empty():
cdef int i = 20
for i in range(4,0):
print u"Spam!"
return i # == 3
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

