Type hint mismatch for list API responses
维护者通常 1 天内回复
@AyeshaNasirWebDeveloper 已经在做这个了。
开始于 2026年8月19日。
评估
调研方向
先阅读 issue 中的 send_request 入口和 Ticker24hrResponse2.from_dict 示例,然后跟踪顶层列表响应是如何进行注解和解析的。完成的标准是:对于列表响应,声明的返回类型与运行时的 ApiResponse[list[T]] 行为一致,同时不改变其他响应形状的处理方式。
由索引模型根据 Issue 内容生成。
描述
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]
- 主要语言
- Python
- 星标
- 3k
- 派生
- 712
- 平均合并
- 1 天 13 小时
- 30 天内合并 PR
- 9
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
binance/binance-connector-python 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 55/100
binance/binance-connector-python#587 · 1 条评论 ·
维护者通常 1 天内回复
-
USDⓈ-M exchangeInfo:请明确 POSITION_RISK_CONTROL / positionControlSide 的语义与枚举可能已有人在做 @Tyagiquamar 于 3 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 15/100
binance/binance-connector-python#575 · 2 条评论 ·
维护者通常 1 天内回复
-
[Bug] Response models declare numeric fields as strict `str`, causing silent fallback of `.data()` to raw dict (simple-earn & staking)可能已有人在做 @Tyagiquamar 于 49 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 68/100
binance/binance-connector-python#553 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 20/100
binance/binance-connector-python#498 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 30/100
binance/binance-connector-python#464 · 1 条评论 · 5 个 reaction ·
维护者通常 1 天内回复
查看 binance/binance-connector-python 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
strawberry-graphql/strawberry#4794 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
dataforgoodfr/cetolog#21 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
btclib-org/btclib#2932 ·
维护者通常 1 天内回复
-
metrics priority: medium
难度 1/5 1-3 小时 新手友好度 86/100
LearningCircuit/local-deep-research#8336 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 80/100