[issue29018] Misinformation when showing how slices work in The Tutorial

2016-12-23 Thread issuefinder

issuefinder added the comment:

You seem to be right.
Sorry about the incovenience.

--

___
Python tracker 

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



[issue29018] Misinformation when showing how slices work in The Tutorial

2016-12-19 Thread Steven D'Aprano

Steven D'Aprano added the comment:

You haven't given any reason to explain why you think the existing docs are 
wrong, nor any reason why you think your version is better. Just stating that 
the docs give "misinformation" is not good enough.

By your matrix, 'Python'[0:-1] should take a slice starting from the left of 
'P' and ending at the *right* of 'n', returning 'Python' unchanged. According 
to the original, documented matrix, 'Python'[0:-1] takes a slice starting at 
the left of 'P' and ending at the *left* of 'n', returning 'Pytho'. without the 
n, which is what actually does happen.

You should also consider the slice 'Python'[-6:-5] according to the documented 
matrix (returns 'P') and your matrix (returns 'y').

--
nosy: +steven.daprano
resolution:  -> not a bug
stage:  -> 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



[issue29018] Misinformation when showing how slices work in The Tutorial

2016-12-19 Thread R. David Murray

R. David Murray added the comment:

If your version was correct, 'python'[-2:] would produce 'n', which is not what 
it produces.  Perhaps you being confused by the fact that the diagram is 
pointing the indexes *between* the characters?  That's the point of the 
mnemonic and I find it very useful to think of it that way, myself.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue29018] Misinformation when showing how slices work in The Tutorial

2016-12-19 Thread issuefinder

New submission from issuefinder:

In this page:
https://docs.python.org/3/tutorial/introduction.html#strings

When showing how slices work:
+---+---+---+---+---+---+
 | P | y | t | h | o | n |
 +---+---+---+---+---+---+
 0   1   2   3   4   5   6
-6  -5  -4  -3  -2  -1

The accurate matrix is:

+---+---+---+---+---+---+
 | P | y | t | h | o | n |
 +---+---+---+---+---+---+
 0   1   2   3   4   5   6
 0  -6  -5  -4  -3  -2  -1

--
assignee: docs@python
components: Documentation
messages: 283649
nosy: docs@python, issuefinder
priority: normal
severity: normal
status: open
title: Misinformation when showing how slices work in The Tutorial
versions: Python 3.7

___
Python tracker 

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