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

4.4. break and continue Statements, and else Clauses on Loops #77605

Closed
joesatriani mannequin opened this issue May 4, 2018 · 3 comments
Closed

4.4. break and continue Statements, and else Clauses on Loops #77605

joesatriani mannequin opened this issue May 4, 2018 · 3 comments

Comments

@joesatriani
Copy link
Mannequin

joesatriani mannequin commented May 4, 2018

BPO 33424
Nosy @tim-one, @stevendaprano

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 2018-05-04.03:10:36.475>
created_at = <Date 2018-05-04.03:07:20.656>
labels = []
title = '4.4. break and continue Statements, and else Clauses on Loops'
updated_at = <Date 2018-05-04.06:38:23.482>
user = 'https://bugs.python.org/joesatriani'

bugs.python.org fields:

activity = <Date 2018-05-04.06:38:23.482>
actor = 'steven.daprano'
assignee = 'none'
closed = True
closed_date = <Date 2018-05-04.03:10:36.475>
closer = 'tim.peters'
components = []
creation = <Date 2018-05-04.03:07:20.656>
creator = 'joesatriani'
dependencies = []
files = []
hgrepos = []
issue_num = 33424
keywords = []
message_count = 3.0
messages = ['316158', '316159', '316160']
nosy_count = 3.0
nosy_names = ['tim.peters', 'steven.daprano', 'joesatriani']
pr_nums = []
priority = 'normal'
resolution = 'rejected'
stage = 'resolved'
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue33424'
versions = []

@joesatriani
Copy link
Mannequin Author

joesatriani mannequin commented May 4, 2018

range function second parameter is excluded. Hence for x in range(2, n): will not execute when n = 2, and "2 is a prime number" will never appear.
Moreover, might need a break in the else block too.

@tim-one
Copy link
Member

tim-one commented May 4, 2018

Closing because this appears to be senseless.

@tim-one tim-one closed this as completed May 4, 2018
@stevendaprano
Copy link
Member

Joe, we have no idea what you think is the bug.

It is intentional that the second argument for range is excluded. This is called an "half-open" range, and it helps avoid off-by-one and signpost errors.

Your comments about break, continue and else don't seem to actually mean anything. Please write in complete English sentences and explain the nature of the supposed bug.

@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
None yet
Projects
None yet
Development

No branches or pull requests

2 participants