classification
Title: extended slicing not sufficiently covered in docs
Type: enhancement Stage:
Components: Documentation Versions: Python 3.1, Python 3.2, Python 3.3
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: donlorenzo, georg.brandl, terry.reedy
Priority: normal Keywords:

Created on 2009-12-08 17:20 by donlorenzo, last changed 2011-03-09 03:15 by terry.reedy.

Messages (3)
msg96141 - (view) Author: Lorenz Quack (donlorenzo) * Date: 2009-12-08 17:20
I find the documentation regarding extended slicing to be lacking.
To be honest I couldn't find any documentation about it.
The only - and quite good - source of information I found was [1].
Maybe I didn't search enough. If so I would appreciate a link to the
relevant section.

In fact I didn't really know about extended slicing (except for the
start, stop, step notation) until I implemented a C extension and got a
TypeError in Python 3 because I was only supporting simple slicing. And
this is despite the fact that I don't consider myself a python n00b.

As I am still learning about this protocol at the time of writing. I
might have some things backwards and I don't feel qualified to improve
the docs myself. Instead I would like to point out where I would have
expected some information about this topic:

To begin improvement a hint around "PySequence_GetSlice" that this is a
more or less deprecated API and "tp_as_mapping->mp_subscript" should be
used instead would be useful. 
In addition "PyObject_GetItem/tp_as_mapping->mp_subscript" could say
that a slice object is passed when extended slicing is used.

sincerely yours
//Lorenz

PS: I marked this Python 3.x even though the documentation of 2.x lacks
as well because I only got the TypeError in 3.x whereas in 2.x
everything works fine with simple slicing.

[1] http://mail.python.org/pipermail/python-3000/2007-August/009851.html
msg100501 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2010-03-05 21:46
This may be duplicative of #1446619,
but I have not looked at that enough.
I agree that revision is needed and will try to develop patch suggestions.
msg100503 - (view) Author: Lorenz Quack (donlorenzo) * Date: 2010-03-05 22:10
When I wrote this bug report I was mainly thinking about the C-API documentation which doesn't mention extended slicing at all.
Since the C-API isn't mentioned in the other bug I don't think it's a duplicate but they could maybe be merged if you see any advantage in that.

And thanks for looking into it.
History
Date User Action Args
2011-03-09 03:15:03terry.reedysetnosy: georg.brandl, terry.reedy, donlorenzo
versions: + Python 3.3
2010-10-29 10:07:21adminsetassignee: georg.brandl -> docs@python
2010-03-05 22:10:31donlorenzosetmessages: + msg100503
2010-03-05 21:46:03terry.reedysetnosy: + terry.reedy

messages: + msg100501
versions: - Python 3.0
2009-12-08 17:20:56donlorenzocreate