python-filewrap 0.3.0__tar.gz → 0.3.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_filewrap-0.3.0 → python_filewrap-0.3.0.1}/PKG-INFO +1 -1
- {python_filewrap-0.3.0 → python_filewrap-0.3.0.1}/filewrap/__init__.py +6 -1
- {python_filewrap-0.3.0 → python_filewrap-0.3.0.1}/pyproject.toml +1 -1
- {python_filewrap-0.3.0 → python_filewrap-0.3.0.1}/LICENSE +0 -0
- {python_filewrap-0.3.0 → python_filewrap-0.3.0.1}/filewrap/py.typed +0 -0
- {python_filewrap-0.3.0 → python_filewrap-0.3.0.1}/readme.md +0 -0
|
@@ -839,7 +839,12 @@ def to_string_buffer(s: str, /) -> array:
|
|
|
839
839
|
def to_bytes_buffer(b: Buffer, /) -> bytes | bytearray | memoryview:
|
|
840
840
|
if isinstance(b, (bytes, bytearray)):
|
|
841
841
|
return b
|
|
842
|
-
|
|
842
|
+
view = memoryview(b)
|
|
843
|
+
if view.format == "B":
|
|
844
|
+
return view
|
|
845
|
+
if view.c_contiguous:
|
|
846
|
+
return view.cast("B")
|
|
847
|
+
return view.tobytes()
|
|
843
848
|
|
|
844
849
|
|
|
845
850
|
def bio_chunk_iter(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|