[issue28197] range.index mismatch with documentation

2017-10-28 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: rhettinger -> ___ Python tracker ___

[issue28197] range.index mismatch with documentation

2017-10-22 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- stage: -> needs patch ___ Python tracker ___

[issue28197] range.index mismatch with documentation

2016-09-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Why can't this go into 3.6? Because it is a new feature and we're already past beta 1; because nothing is actually broken; and because it is a very minor issue (x isn't 100% consistent with y); because this would depend on new code and tests that we

[issue28197] range.index mismatch with documentation

2016-09-21 Thread Vedran Čačić
Vedran Čačić added the comment: Why can't this go into 3.6? To me this situation seems like a bug. -- ___ Python tracker ___

[issue28197] range.index mismatch with documentation

2016-09-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: > 2) Add the support of stop and start arguments to range() in 3.7. Yes, the whole point of adding these bogus methods in the first place was to harmonize the range object with other sequence types. -- ___

[issue28197] range.index mismatch with documentation

2016-09-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry for poor words. I was not going to blame anybody. But changing interface always is dangerous. It makes third-party classes that implemented the interface no longer valid substitutions. I think two things are worth to be done: 1) Explicitly document

[issue28197] range.index mismatch with documentation

2016-09-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: > I'd argue that range can implement the 3-arg .index much better > than generic Sequence. Yes, the range index() method should implement all three arguments. That shouldn't be difficult. -- assignee: docs@python -> type: behavior -> enhancement

[issue28197] range.index mismatch with documentation

2016-09-18 Thread Vedran Čačić
Vedran Čačić added the comment: Yes, I agree these are useless _if you know you're dealing with range_. However, if you have a Sequence, it would be very useful not to have range be a special case. Of course, one solution is to have a default .index implementation in the Sequence ABC itself,

[issue28197] range.index mismatch with documentation

2016-09-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: > These broke some concrete Sequence implementations. Poor choice of words. The concrete implementations didn't change at all. Perhaps the concrete implementation need to be brought more in-sync with the ABC. That would be reasonable; afteralll the goal

[issue28197] range.index mismatch with documentation

2016-09-18 Thread Vedran Čačić
Vedran Čačić added the comment: Yes, that's the precise reason I caught this. I was implementing some tools to do with Sequences (seqtools, like itertools but having non-ephemeral output given non-ephemeral input), and the Sequence that was easiest to test quickly was range. In `positions`

[issue28197] range.index mismatch with documentation

2016-09-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Parameters start and stop were added to the Sequence.index() mixin method in issue23086. These broke some concrete Sequence implementations. -- nosy: +Devin Jeanpierre, rhettinger, serhiy.storchaka ___ Python

[issue28197] range.index mismatch with documentation

2016-09-18 Thread SilentGhost
Changes by SilentGhost : -- versions: +Python 3.7 ___ Python tracker ___ ___

[issue28197] range.index mismatch with documentation

2016-09-18 Thread Vedran Čačić
New submission from Vedran Čačić: Look at this: >>> from collections.abc import Sequence >>> help(Sequence.index) index(self, value, start=0, stop=None) S.index(value, [start, [stop]]) -> integer -- return first index of value. Raises ValueError if the value is not