Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extended slicing not sufficiently covered in docs #51709

Open
donlorenzo mannequin opened this issue Dec 8, 2009 · 3 comments
Open

extended slicing not sufficiently covered in docs #51709

donlorenzo mannequin opened this issue Dec 8, 2009 · 3 comments
Labels
3.8 only security fixes 3.9 only security fixes 3.10 only security fixes docs Documentation in the Doc dir type-feature A feature request or enhancement

Comments

@donlorenzo
Copy link
Mannequin

donlorenzo mannequin commented Dec 8, 2009

BPO 7460
Nosy @birkenfeld, @terryjreedy

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2009-12-08.17:20:56.139>
labels = ['type-feature', '3.8', '3.9', '3.10', 'docs']
title = 'extended slicing not sufficiently covered in docs'
updated_at = <Date 2020-11-21.16:51:08.801>
user = 'https://bugs.python.org/donlorenzo'

bugs.python.org fields:

activity = <Date 2020-11-21.16:51:08.801>
actor = 'iritkatriel'
assignee = 'docs@python'
closed = False
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2009-12-08.17:20:56.139>
creator = 'donlorenzo'
dependencies = []
files = []
hgrepos = []
issue_num = 7460
keywords = []
message_count = 3.0
messages = ['96141', '100501', '100503']
nosy_count = 3.0
nosy_names = ['georg.brandl', 'terry.reedy', 'donlorenzo']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue7460'
versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

@donlorenzo
Copy link
Mannequin Author

donlorenzo mannequin commented Dec 8, 2009

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

@donlorenzo donlorenzo mannequin assigned birkenfeld Dec 8, 2009
@donlorenzo donlorenzo mannequin added docs Documentation in the Doc dir type-feature A feature request or enhancement labels Dec 8, 2009
@terryjreedy
Copy link
Member

This may be duplicative of bpo-1446619,
but I have not looked at that enough.
I agree that revision is needed and will try to develop patch suggestions.

@donlorenzo
Copy link
Mannequin Author

donlorenzo mannequin commented Mar 5, 2010

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.

@admin admin mannequin assigned docspython and unassigned birkenfeld Oct 29, 2010
@iritkatriel iritkatriel added 3.8 only security fixes 3.9 only security fixes 3.10 only security fixes labels Nov 21, 2020
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.8 only security fixes 3.9 only security fixes 3.10 only security fixes docs Documentation in the Doc dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants