forked from weaselab/conflict-set
Fix python type annotation
This commit is contained in:
+4
-2
@@ -2,6 +2,8 @@ import ctypes
|
|||||||
import enum
|
import enum
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
from typing import Optional
|
||||||
|
|
||||||
_lib = None
|
_lib = None
|
||||||
for f in (
|
for f in (
|
||||||
os.path.dirname(__file__) + "/build/radix_tree/libconflict-set.so.0",
|
os.path.dirname(__file__) + "/build/radix_tree/libconflict-set.so.0",
|
||||||
@@ -63,7 +65,7 @@ class Result(enum.Enum):
|
|||||||
TOO_OLD = 2
|
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 = (ctypes.c_ubyte * len(begin))()
|
||||||
b.value = begin
|
b.value = begin
|
||||||
if end is None:
|
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)))
|
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 = (ctypes.c_ubyte * len(begin))()
|
||||||
b.value = begin
|
b.value = begin
|
||||||
if end is None:
|
if end is None:
|
||||||
|
|||||||
Reference in New Issue
Block a user