Hi! I’m currently using the binance-sdk-derivatives-trading-usds-futures SDK while migrating from the deprecated version.
I noticed that the return type of the USD Futures API is always annotated as ApiResponse[T], but in cases where the response is a top-level list, the actual return type is ApiResponse[list[T]].
Is this intentional?
def send_request(...):
...
if (is_list and not is_flat_list) or not response_model:
data_function = lambda: parsed
elif is_oneof or is_list:
data_function = lambda: response_model.from_dict(parsed)
else:
data_function = lambda: response_model.model_validate(parsed)
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[list[Self]]:
"""Create an instance of Ticker24hrResponse2 from a dict"""
return [cls.model_validate(item) for item in obj]
Hi! I’m currently using the
binance-sdk-derivatives-trading-usds-futuresSDK while migrating from the deprecated version.I noticed that the return type of the USD Futures API is always annotated as
ApiResponse[T], but in cases where the response is a top-level list, the actual return type isApiResponse[list[T]].Is this intentional?