tobinarray end parameter is inconsistent with standard python range behaviour
Bug #372625 reported by
sneakypete
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
IntelHex |
Opinion
|
Medium
|
Unassigned |
Bug Description
Python "range"-style functions define the stop parameter as "non-inclusive":
range(0, 10)
returns [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
len(range(0, 10))
returns 10
However tobinarray's end parameter is "inclusive"
len(ih.
returns 11
Changed in intelhex: | |
milestone: | 2.0 → none |
To post a comment you must log in.
Yes, this is intended behavior from the day one of intelhex library development. Change this is too late, because it will be serious API break.
I can only improve the documentation for `end' parameter of various functions and explicitly say it's inclusive.