range behaves in an odd way with unsigned types
|Reported by:||dagss||Owned by:||robertwb|
I was just bitten by this:
cdef unsigned i = 10 print range(-i, i) for x in range(-i, i): print "entered"
This will print out an empty list, and not enter the loop. This is odd, considered that
def f(int a, int b): print a, b cdef unsigned i i = 10 f(-i, i)
will print out -10, 10.
Change History (10)
comment:4 Changed 6 years ago by dagss
- Summary changed from range behaves oddly with unsigned types to range behaves in an odd way with unsigned types
comment:8 Changed 6 years ago by robertwb
- Resolution invalid deleted
- Status changed from closed to reopened
comment:9 Changed 6 years ago by robertwb
- Owner changed from somebody to robertwb
- Status changed from reopened to new
Note: See TracTickets for help on using tickets.