Skip to content

Conversation

@iritkatriel
Copy link
Member

@iritkatriel iritkatriel commented Sep 23, 2024

Copy link
Member

@markshannon markshannon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice.
One suggestion for a comment, otherwise lgtm.

@JelleZijlstra
Copy link
Member

@ncoghlan on the issue suggested we could do this in the AST optimizer without changing the eval loop. Is that approach worth considering? It would involve transforming a and b or c into (b or c) if a else c.

@iritkatriel
Copy link
Member Author

@ncoghlan on the issue suggested we could do this in the AST optimizer without changing the eval loop. Is that approach worth considering? It would involve transforming a and b or c into (b or c) if a else c.

I'm not sure I see what the general solution is, but I'm all for trying it.

@iritkatriel
Copy link
Member Author

I'll merge this though - we can easily replace this with the alternative idea. The "sequence" pseudo-ops change is worth having anyway.

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

Successfully merging this pull request may close these issues.

Behavior change for foo and 1 or 2: 3.12 newly converts foo to bool twice

3 participants