aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/Pillow/py3/PIL/_binary.py
diff options
context:
space:
mode:
authorkickbutt <kickbutt@yandex-team.com>2024-01-23 23:36:43 +0300
committerkickbutt <kickbutt@yandex-team.com>2024-01-23 23:55:22 +0300
commitfe742a0b69a530f86d1ea7aa84978d673256f8b7 (patch)
treea045a5eb8dba770797e84d0b233098605396027d /contrib/python/Pillow/py3/PIL/_binary.py
parentbd7d89b121ae7b9f4427766292c950fcc91c2975 (diff)
downloadydb-fe742a0b69a530f86d1ea7aa84978d673256f8b7.tar.gz
Fix separator in CUDA_ARCHITECTURES
Diffstat (limited to 'contrib/python/Pillow/py3/PIL/_binary.py')
-rw-r--r--contrib/python/Pillow/py3/PIL/_binary.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/contrib/python/Pillow/py3/PIL/_binary.py b/contrib/python/Pillow/py3/PIL/_binary.py
index a74ee9eb6f3..0a07e8d0e12 100644
--- a/contrib/python/Pillow/py3/PIL/_binary.py
+++ b/contrib/python/Pillow/py3/PIL/_binary.py
@@ -13,21 +13,21 @@
"""Binary input/output support routines."""
-
+from __future__ import annotations
from struct import pack, unpack_from
-def i8(c):
- return c if c.__class__ is int else c[0]
+def i8(c: bytes) -> int:
+ return c[0]
-def o8(i):
+def o8(i: int) -> bytes:
return bytes((i & 255,))
# Input, le = little endian, be = big endian
-def i16le(c, o=0):
+def i16le(c: bytes, o: int = 0) -> int:
"""
Converts a 2-bytes (16 bits) string to an unsigned integer.
@@ -37,7 +37,7 @@ def i16le(c, o=0):
return unpack_from("<H", c, o)[0]
-def si16le(c, o=0):
+def si16le(c: bytes, o: int = 0) -> int:
"""
Converts a 2-bytes (16 bits) string to a signed integer.
@@ -47,7 +47,7 @@ def si16le(c, o=0):
return unpack_from("<h", c, o)[0]
-def si16be(c, o=0):
+def si16be(c: bytes, o: int = 0) -> int:
"""
Converts a 2-bytes (16 bits) string to a signed integer, big endian.
@@ -57,7 +57,7 @@ def si16be(c, o=0):
return unpack_from(">h", c, o)[0]
-def i32le(c, o=0):
+def i32le(c: bytes, o: int = 0) -> int:
"""
Converts a 4-bytes (32 bits) string to an unsigned integer.
@@ -67,7 +67,7 @@ def i32le(c, o=0):
return unpack_from("<I", c, o)[0]
-def si32le(c, o=0):
+def si32le(c: bytes, o: int = 0) -> int:
"""
Converts a 4-bytes (32 bits) string to a signed integer.
@@ -77,26 +77,26 @@ def si32le(c, o=0):
return unpack_from("<i", c, o)[0]
-def i16be(c, o=0):
+def i16be(c: bytes, o: int = 0) -> int:
return unpack_from(">H", c, o)[0]
-def i32be(c, o=0):
+def i32be(c: bytes, o: int = 0) -> int:
return unpack_from(">I", c, o)[0]
# Output, le = little endian, be = big endian
-def o16le(i):
+def o16le(i: int) -> bytes:
return pack("<H", i)
-def o32le(i):
+def o32le(i: int) -> bytes:
return pack("<I", i)
-def o16be(i):
+def o16be(i: int) -> bytes:
return pack(">H", i)
-def o32be(i):
+def o32be(i: int) -> bytes:
return pack(">I", i)