gh-131798: JIT: Narrow the return type of _BINARY_SLICE to original container type#133527
gh-131798: JIT: Narrow the return type of _BINARY_SLICE to original container type#133527Zheaoli wants to merge 1 commit intopython:mainfrom
Conversation
…inal container type Signed-off-by: Manjusaka <me@manjusaka.me>
|
@Zheaoli, I appreciate you taking the time to do this, but somebody else is already working on 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'> |
Sorry about this! I have not noticed this has been assigned. |
Sure! |
Thanks about the explain. You prove one of my guess. |
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