Fix python type annotation

This commit is contained in:
2024-04-07 22:28:40 -07:00
parent 1c900c5a8c
commit 193b1926ff
+4 -2
View File
@@ -2,6 +2,8 @@ import ctypes
import enum
import os
from typing import Optional
_lib = None
for f in (
os.path.dirname(__file__) + "/build/radix_tree/libconflict-set.so.0",
@@ -63,7 +65,7 @@ class Result(enum.Enum):
TOO_OLD = 2
def write(begin: bytes, end: bytes | None = None) -> WriteRange:
def write(begin: bytes, end: Optional[bytes] = None) -> WriteRange:
b = (ctypes.c_ubyte * len(begin))()
b.value = begin
if end is None:
@@ -75,7 +77,7 @@ def write(begin: bytes, end: bytes | None = None) -> WriteRange:
return WriteRange(_Key(b, len(b)), _Key(e, len(e)))
def read(version: int, begin: bytes, end: bytes = None) -> ReadRange:
def read(version: int, begin: bytes, end: Optional[bytes] = None) -> ReadRange:
b = (ctypes.c_ubyte * len(begin))()
b.value = begin
if end is None: