We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
GitHub fields:
assignee = None closed_at = <Date 2008-07-03.20:51:29.437> created_at = <Date 2008-07-03.20:43:13.035> labels = ['interpreter-core', 'performance'] title = 'Control flow not optimized' updated_at = <Date 2008-07-04.09:05:53.312> user = 'https://bugs.python.org/quotemstr'
bugs.python.org fields:
activity = <Date 2008-07-04.09:05:53.312> actor = 'georg.brandl' assignee = 'none' closed = True closed_date = <Date 2008-07-03.20:51:29.437> closer = 'benjamin.peterson' components = ['Interpreter Core'] creation = <Date 2008-07-03.20:43:13.035> creator = 'quotemstr' dependencies = [] files = [] hgrepos = [] issue_num = 3275 keywords = [] message_count = 3.0 messages = ['69230', '69231', '69248'] nosy_count = 3.0 nosy_names = ['georg.brandl', 'benjamin.peterson', 'quotemstr'] pr_nums = [] priority = 'normal' resolution = 'rejected' stage = None status = 'closed' superseder = None type = 'performance' url = 'https://bugs.python.org/issue3275' versions = ['Python 2.5']
The text was updated successfully, but these errors were encountered:
Consider:
import dis def foo(): if 0 and 1: return "hi" dis.dis(foo)
What I get is
2 0 LOAD_CONST 1 (0) 3 JUMP_IF_FALSE 15 (to 21) 6 POP_TOP 7 LOAD_CONST 2 (1) 10 JUMP_IF_FALSE 8 (to 21) 13 POP_TOP 14 LOAD_CONST 3 ('hi') 17 RETURN_VALUE 18 JUMP_FORWARD 1 (to 22) >> 21 POP_TOP >> 22 LOAD_CONST 0 (None) 25 RETURN_VALUE
What I'd expect to see is:
1 0 LOAD_CONST 0 (None) 3 RETURN_VALUE
Sorry, something went wrong.
A patch for this was just recently rejected. See bpo-1394.
What real-life use case do you have for a condition that is a boolean operation on two constant values anyway? Things like
while 1: ...
are properly optimized since they serve a useful purpose.
No branches or pull requests
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: