FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-131798: JIT: Narrow the return type of _BINARY_SLICE to original container type by Zheaoli · Pull Request #133527 · python/cpython · GitHub

Repository navigation

gh-131798: JIT: Narrow the return type of _BINARY_SLICE to original container type - #133527

Closed
Zheaoli wants to merge 1 commit into
python:mainfrom
Zheaoli:manjusaka/binary-slice
Closed

Zheaoli wants to merge 1 commit into
python:mainfrom
Zheaoli:manjusaka/binary-slice

Conversation

Zheaoli commented May 6, 2025 •
edited
Loading

Copy link
Copy Markdown
Contributor

I'm not sure this patch will take some effect.

In my original thought, I think if we can setup the return type to the original container type(tuple, list etc.), the optimizer will specialize some code in the test.

but the test is not work on my thought. I guess I miss something important here. cc @brandtbucher @Fidget-Spinner

…inal container type

Signed-off-by: Manjusaka <me@manjusaka.me>

Copy link
Copy Markdown
Member

@Zheaoli, I appreciate you taking the time to do this, but somebody else is already working on _BINARY_SLICE. Part of the reason I created an issue for this was so we could coordinate the work, rather than having multiple people racing on the same tasks.

Is it okay if we close this? FYI, one issue I see here is that there is no guarantee that slicing an arbitrary object will give you the same class (we need to check for some common classes instead):

>>> import mmap
>>> mm = mmap.mmap(-1, 42)
>>> type(mm)
<class 'mmap.mmap'>
>>> type(mm[:])
<class 'bytes'>

Zheaoli commented May 7, 2025

Copy link
Copy Markdown
Contributor Author

I appreciate you taking the time to do this, but somebody else is already working on _BINARY_SLICE. Part of the reason I created an issue for this was so we could coordinate the work, rather than having multiple people racing on the same tasks.

Sorry about this! I have not noticed this has been assigned.

Zheaoli commented May 7, 2025

Copy link
Copy Markdown
Contributor Author

Is it okay if we close this?

Sure!

Zheaoli closed this May 7, 2025
Zheaoli deleted the manjusaka/binary-slice branch May 7, 2025 02:42

Zheaoli commented May 7, 2025

Copy link
Copy Markdown
Contributor Author

one issue I see here is that there is no guarantee that slicing an arbitrary object will give you the same class (we need to check for some common classes instead):

Thanks about the explain. You prove one of my guess.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

2 participants


Back | FazBrowse Home | New Git URL