Message65827
| Author |
belopolsky |
| Recipients |
amaury.forgeotdarc, belopolsky, benjamin.peterson, georg.brandl, gvanrossum, pitrou, rhettinger |
| Date |
2008年04月25日.23:35:11 |
| SpamBayes Score |
0.16142794 |
| Marked as misclassified |
No |
| Message-id |
<d38f5330804251635t56320317od85718a09a66e48c@mail.gmail.com> |
| In-reply-to |
<ca471dc20804251610u23925ae3kc641071ce5e66233@mail.gmail.com> |
| Content |
On Fri, Apr 25, 2008 at 7:10 PM, Guido van Rossum
<report@bugs.python.org> wrote:
..
> I think I'd be okay with normalization on creation, so that range(0,
> 5, 2) returns range(0, 6, 2). Hm, but isn't that odd? Why not the
> other way around?
I find it natural to have start + len*step = stop invariant rather
than start +(len-1)*step + 1 = stop. I may be influenced by C++ (STL)
tradition of giving preference to "i != stop" over "i < stop"
condition so that algorithms support iterators that are not ordered.
I also believe some algorithmic simplifications will be possible with
start + len*step = stop invariant. |
|