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

[doc] inconsistent range example output #67747

Closed
bleuse mannequin opened this issue Mar 2, 2015 · 2 comments
Closed

[doc] inconsistent range example output #67747

bleuse mannequin opened this issue Mar 2, 2015 · 2 comments
Labels
docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error

Comments

@bleuse
Copy link
Mannequin

bleuse mannequin commented Mar 2, 2015

BPO 23559
Nosy @birkenfeld

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 = <Date 2015-03-02.08:56:30.205>
created_at = <Date 2015-03-02.08:21:16.463>
labels = ['type-bug', 'invalid', 'docs']
title = '[doc] inconsistent range example output'
updated_at = <Date 2015-03-02.08:56:30.154>
user = 'https://bugs.python.org/bleuse'

bugs.python.org fields:

activity = <Date 2015-03-02.08:56:30.154>
actor = 'georg.brandl'
assignee = 'docs@python'
closed = True
closed_date = <Date 2015-03-02.08:56:30.205>
closer = 'georg.brandl'
components = ['Documentation']
creation = <Date 2015-03-02.08:21:16.463>
creator = 'bleuse'
dependencies = []
files = []
hgrepos = []
issue_num = 23559
keywords = []
message_count = 2.0
messages = ['237029', '237033']
nosy_count = 3.0
nosy_names = ['georg.brandl', 'docs@python', 'bleuse']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue23559'
versions = ['Python 3.5']

@bleuse
Copy link
Mannequin Author

bleuse mannequin commented Mar 2, 2015

Reading the documentation for ranges (see https://docs.python.org/3.5/library/stdtypes.html#ranges), the example using a negative index output is inconsistent with the range effective behaviour.

One can read:
"
>>> r[-1]
18
"
while (in my understanding) it should be:
"
>>> r[-1]
8
"

Note the output should be 8 and not 18.

Raphaël

@bleuse bleuse mannequin assigned docspython Mar 2, 2015
@bleuse bleuse mannequin added docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error labels Mar 2, 2015
@birkenfeld
Copy link
Member

The example is correct. "r" is a range(0, 20, 2), whose last element is 18.

@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
docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant