[Enhancement] Add a Clear method to the Message class for compatibility.
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 35/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- python
研究方向
從抽象的 Message 類別以及現有的 parse 和預設值邏輯開始;將它們的行為與標準 protobuf 進行比較,包括使用者定義的預設值。當 clear 方法將所有欄位重設為其預設值,並支援 #323 和 #336 中描述的相容性工作時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
When converting existing code to use this module over standard protobuf, one issue raised was the lack of ParseFromString. This has already been mentioned at #323, with a PR in the works at #336. However, this is blocked because it does not perform the same calls as the standard, namely, Clear. In my use of this module, i have worked around this issue by simply creating a new instance (which is always the default) instead of using an existing one, at which point just calling parse works fine.
Ideally, we'd need a clear function (preferably lowercase to match python syntax, but might want TitleCase for compatibility) on the abstract Message class and an implementation that resets all fields to their default values. We'd need to confirm that our implementation matches standard protobuf when it comes to user-defined default values.
to be clear, this isn't a bug, and it doesn't prevent the use of this module.
I'd look into addressing this myself but the logic used to set default values eludes me, at least at first glance.
- 主要語言
- Python
- 星號
- 1.8k
- 分支
- 236
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
danielgtaylor/python-betterproto 的其他 Issue
-
難度 3/5 1-2 天 新手友好度 55/100
-
難度 5/5 一週以上 新手友好度 15/100
-
bug investigation needed
難度 3/5 1-2 天 新手友好度 42/100
-
bug investigation needed
難度 3/5 1-2 天 新手友好度 45/100
-
bug investigation needed
難度 4/5 3-5 天 新手友好度 38/100
danielgtaylor/python-betterproto#676 · 3 則留言 ·
查看 danielgtaylor/python-betterproto 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
huggingface/deep-rl-class#723 ·
-
[tool] bug: Qwen3 XML tool parser raises on `...` argument values (Ellipsis is not JSON serializable)可能已有人在做 @super-yuki 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 87/100
verl-project/verl#8559 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 75/100
TencentCloud/octop-harness#228 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
google/osv-scalibr#2585 ·
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 85/100
NousResearch/hermes-agent#149323 ·
維護者通常 1 天內回覆