You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a few questions about this function that would help me write tests for it. I think @jhamman@normanrz are the main people I need answers from, but I'd be curious to hear if anyone else has thoughts.
the annotation of the function signature is Optional[Tuple[int, Optional[int]]], but the body of the function can handle tuple[None, int]. Should we change annotation of the function signature to tuple[int | None, int | None] | None?
I was initially confused about the semantics of byte_range -- I thought it defined an interval as a start and a stop, but now I understand that byte_range defines a start and a step size. This would be more transparent if we used keyword arguments like start and step instead of a tuple. Would switching to keyword arguments be a problem for this API? I think the win in clarity might be worth it.
The text was updated successfully, but these errors were encountered:
the annotation of the function signature is Optional[Tuple[int, Optional[int]]], but the body of the function can handle tuple[None, int]. Should we change annotation of the function signature to tuple[int | None, int | None] | None?
The current API is:
classByteRange(NamedTuple):
start: int# Can be negative for indexing from the end end: Optional[int] =Nonedef_get(path: Path, byte_range: Optional[ByteRange] =None) ->bytes:
Not sure why we would allow start == None. Would that be equivalent to start == 0?
I was initially confused about the semantics of byte_range -- I thought it defined an interval as a start and a stop, but now I understand that byte_range defines a start and a step size. This would be more transparent if we used keyword arguments like start and step instead of a tuple. Would switching to keyword arguments be a problem for this API? I think the win in clarity might be worth it.
I don't think the byte range defines a step size. Where are you getting that from?
in v3, the following function gets bytes for the
LocalStore.get
method:I have a few questions about this function that would help me write tests for it. I think @jhamman @normanrz are the main people I need answers from, but I'd be curious to hear if anyone else has thoughts.
Optional[Tuple[int, Optional[int]]]
, but the body of the function can handletuple[None, int]
. Should we change annotation of the function signature totuple[int | None, int | None] | None
?byte_range
-- I thought it defined an interval as a start and a stop, but now I understand thatbyte_range
defines a start and a step size. This would be more transparent if we used keyword arguments likestart
andstep
instead of a tuple. Would switching to keyword arguments be a problem for this API? I think the win in clarity might be worth it.The text was updated successfully, but these errors were encountered: