[issue1446619] extended slice behavior inconsistent with docs

2016-12-24 Thread Martin Panter

Changes by Martin Panter :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1446619] extended slice behavior inconsistent with docs

2016-12-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b0b17b41edfc by Martin Panter in branch '3.5':
Issue #1446619: Account for negative slice direction in description
https://hg.python.org/cpython/rev/b0b17b41edfc

New changeset 031af2160094 by Martin Panter in branch '3.6':
Issue #1446619: Merge slicing description from 3.5
https://hg.python.org/cpython/rev/031af2160094

New changeset 4383d403aaef by Martin Panter in branch 'default':
Issue #1446619: Merge slicing description from 3.6
https://hg.python.org/cpython/rev/4383d403aaef

New changeset d63a11bd98ce by Martin Panter in branch '2.7':
Issue #1446619: Account for negative slice direction in description
https://hg.python.org/cpython/rev/d63a11bd98ce

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1446619] extended slice behavior inconsistent with docs

2016-12-10 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1446619] extended slice behavior inconsistent with docs

2016-12-09 Thread Martin Panter

Martin Panter added the comment:

Patch ruling out the len(s) corner case. I use a modified version of Fumihiro’s 
suggestion.

--
versions: +Python 3.6, Python 3.7 -Python 3.4
Added file: http://bugs.python.org/file45827/extended_slicing_docs.v2.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1446619] extended slice behavior inconsistent with docs

2016-12-09 Thread Martin Panter

Martin Panter added the comment:

Fumihiro’s suggestion seems reasonable to me (assuming it still applies to the 
current text)

--
nosy: +martin.panter

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1446619] extended slice behavior inconsistent with docs

2014-09-23 Thread Fumihiro Bessho

Fumihiro Bessho added the comment:

I also wondered the same thing today and found this issue.

I've added my comment on the patch to make the change more precise. Can anyone 
move it ahead and update the document?

--
nosy: +bessho

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1446619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1446619] extended slice behavior inconsistent with docs

2014-06-16 Thread Mark Lawrence

Mark Lawrence added the comment:

The attached patch is simple enough, surely it's a simple decision as to 
whether or not to commit it?

--
nosy: +BreamoreBoy
versions: +Python 3.4, Python 3.5 -Python 3.2, Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1446619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1446619] extended slice behavior inconsistent with docs

2011-03-27 Thread Steven Bethard

Steven Bethard steven.beth...@gmail.com added the comment:

The problem still exists in current trunk:

The slicing semantics have been removed from the expressions reference:
http://docs.python.org/py3k/reference/expressions.html#slicings

The datamodel and types sections still have the same equations:
http://docs.python.org/py3k/reference/datamodel.html#types
http://docs.python.org/py3k/library/stdtypes.html#typesseq

Here's a synopsis of the problem, in code:

 # positive step, works as described
 i, j, k = 2, 8, 2
 range(10)[i:j:k]
[2, 4, 6]
 [i + n * k for n in range(0, (j - i) / k)]
[2, 4, 6]
 [range(10)[i] for i in _]
[2, 4, 6]

 # negative step, does not work as described
 i, j, k = 10, 0, -2
 range(10)[i:j:k]
[9, 7, 5, 3, 1]
 [i + n * k for n in range(0, (j - i) / k)]
[10, 8, 6, 4, 2]
 [range(10)[i] for i in _]
Traceback (most recent call last):
  File stdin, line 1, in module
IndexError: list index out of range

 # actual behavior trims 10 to 9 (is the same as 9:0:-2)
 # that is, it trims to len(s) - 1, not len(s)
 range(10)[9:0:-2]
[9, 7, 5, 3, 1]

I propose to ignore the definition in the datamodel section, since it's talking 
about extended slicing in general, and doesn't mention anything about negative 
indices.

I propose the attached patch to fix the definition in the types section, which 
simply changes the statement:

  If i or j is greater than len(s), use len(s)

to say:

  If *i* or *j* is greater than len(s), use len(s) if *k* is positive, 
  or len(s) - 1 if *k* is negative.

--
keywords: +patch
versions: +Python 2.7, Python 3.2, Python 3.3 -Python 2.6, Python 3.0
Added file: http://bugs.python.org/file21428/extended_slicing_docs.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1446619
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1446619] extended slice behavior inconsistent with docs

2011-03-27 Thread Steven Bethard

Changes by Steven Bethard steven.beth...@gmail.com:


--
stage: test needed - patch review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1446619
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1446619] extended slice behavior inconsistent with docs

2011-03-27 Thread Mark Dickinson

Changes by Mark Dickinson dicki...@gmail.com:


--
nosy: +mark.dickinson

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1446619
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1446619] extended slice behavior inconsistent with docs

2010-08-21 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
assignee: georg.brandl - d...@python
nosy: +d...@python

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1446619
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1446619] extended slice behavior inconsistent with docs

2009-04-05 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

See also #1265100.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1446619
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1446619] extended slice behavior inconsistent with docs

2009-04-05 Thread Steven Bethard

Changes by Steven Bethard steven.beth...@gmail.com:


--
nosy: +bethard -bediviere.historic

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1446619
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1446619] extended slice behavior inconsistent with docs

2009-03-20 Thread Daniel Diniz

Changes by Daniel Diniz aja...@gmail.com:


--
assignee:  - georg.brandl
components: +Documentation -None
nosy: +georg.brandl
stage:  - test needed
type:  - behavior
versions: +Python 2.6, Python 3.0 -Python 2.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1446619
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com