Skip to content

Conversation

Zheaoli
Copy link
Contributor

@Zheaoli Zheaoli commented May 6, 2025

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>
@brandtbucher
Copy link
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
Copy link
Contributor Author

Zheaoli commented May 7, 2025

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
Copy link
Contributor Author

Zheaoli commented May 7, 2025

Is it okay if we close this?

Sure!

@Zheaoli Zheaoli closed this May 7, 2025
@Zheaoli Zheaoli deleted the manjusaka/binary-slice branch May 7, 2025 02:42
@Zheaoli
Copy link
Contributor Author

Zheaoli commented May 7, 2025

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.

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