Skip to content

gh-115480: Type propagate _BINARY_OP_ADD_UNICODE - #115710

Merged
Fidget-Spinner merged 4 commits into
python:mainfrom
Fidget-Spinner:binary_op_add_unicode
Mar 1, 2024
Merged

Fidget-Spinner merged 4 commits into
python:mainfrom
Fidget-Spinner:binary_op_add_unicode

Conversation

@Fidget-Spinner

@Fidget-Spinner Fidget-Spinner commented Feb 20, 2024 •

Copy link
Copy Markdown
Member
@Fidget-Spinner

Copy link
Copy Markdown
Member Author

Needs #115686 to be merged first.

Comment thread Lib/test/test_capi/test_opt.py Resolved
@mdboom mdboom mentioned this pull request Feb 28, 2024
22 of 32 tasks

@gvanrossum gvanrossum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's go ahead and merge this.

Comment on lines +858 to +861
a + a
a + a
a + a
a + a

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sooner or later we'll have a peephole pass that will delete the generated code for this completely. Is there a reason you're not doing something like a = a + a?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That transforms it to BINARY_OP_INPLACE_ADD_UNICODE sadly. Which is an unsupported opcode, so the trace ends there.

@Fidget-Spinner
Fidget-Spinner merged commit ff96b81 into python:main Mar 1, 2024
@Fidget-Spinner
Fidget-Spinner deleted the binary_op_add_unicode branch March 1, 2024 19:40
woodruffw pushed a commit to woodruffw-forks/cpython that referenced this pull request Mar 4, 2024
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 25, 2024
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants