-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
C-compatA discrepancy between RustPython and CPythonA discrepancy between RustPython and CPython
Description
Feature
bytes object is immutable, so constructing a new bytes object from another bytes object doesn't need copying.
However, PyBytes and PyByteArray share PyBytesInner implementation, causing an unnecessary copying of immutable data.
CPython:
>>> b = b'foo'
>>> bytes(b) is b
True
RustPython:
>>> b = b'foo'
>>> bytes(b) is b
False
Python Documentation
https://docs.python.org/3/library/stdtypes.html#bytes-objects
coolreader18, youknowone and antonromanov1
Metadata
Metadata
Assignees
Labels
C-compatA discrepancy between RustPython and CPythonA discrepancy between RustPython and CPython