Update custom type_caster doc with a more complete example
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 60/100
- issue の種類
- ドキュメント
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
調査の方向性
Issue にリンクされている custom type casters のページから始め、既存の load(handle, bool) に関するガイダンスを確認します。予期しない型に対する reference_cast_error() と、失敗した Python エラーのクリアを扱う、より完全な例でドキュメントを更新します。これらの要件が例の中で明確に説明されていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
I have recently come across strange errors (XXX undetected error) when calling overloaded methods that take as input objects that have custom type_caster instantiations. After some debugging, I found that a custom pybind11 type_caster<>::load(handle,bool) method must not only return a bool to denote its successful conversion, but must also throw a reference_cast_error() when the handle is not the expected type (to facilitate its use in pybind11's try/catch dispatch for overloaded methods). Also, the failed attempts to convert the handle likely raise a python error which, if left uncleared, will manifest in strange behavior elsewhere in the program. The readthedocs for custom type casters doesn't really cover these crucial requirements on the load method. It would have been useful for me to read about this in the documentation, so I figure it would probably be useful for someone else to read it too!
- 主要言語
- C++
- スター
- 18k
- フォーク
- 2.3k
- 平均マージ
- 5日 17時間
- マージ済み PR(30日)
- 8
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pybind/pybind11 のほかの issue
-
triage
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
triage
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
pybind/pybind11#5604 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
triage
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
pybind/pybind11 の issue をすべて見る
似ている issue
-
area/actorsystem bug tsan
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
ydb-platform/ydb#54282 ·
メンテナーはふだん 1 日以内に返信
-
bug needs triage
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
project-chip/connectedhomeip#74434 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
tenstorrent/tt-metal#58057 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
maplibre/maplibre-native#4690 ·
メンテナーはふだん 1 日以内に返信
-
comp-query-execution
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
ClickHouse/ClickHouse#122569 ·
メンテナーはふだん 1 日以内に返信