[docs] [issue7940] re.finditer and re.findall should support negative end positions
report at bugs.python.org
Sat Jul 13 14:37:32 EDT 2019
Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:
-1 on the proposal. We don't know of any strong use cases, so there isn't a real problem being solved here. Rather than providing a benefit, this feature request makes it more likely that people will write convoluted code or that it will let bugs pass silently that would otherwise be caught.
ISTM the actual issue here is an incorrect user expectation that "all things that having indexing will support negative indexing". While it is common for objects to implement negative index support, it is not universal or required. Even collections.abc.Sequence does not insist on negative index support.
I think this warrants a FAQ entry (which should also mention that slice support as well is not universal or required, some objects have it, some don't).
Reclassifying this as documentation issue.
assignee: -> docs at python
components: +Documentation -Library (Lib), Regular Expressions
nosy: +docs at python, rhettinger
Python tracker <report at bugs.python.org>
More information about the docs