`PythonWrapper::unwrap` Patch
**Is this pull request associated with an issue(s)?**
No
**Description**
When unwrapping an object wrapped by a `PythonWrapper` to a reference, the recast python object is copied into an `any` buffer. This buffer persists on the `PythonWrapper` and is checked on successive calls to `unwrap` to avoid repetitious effort. If the previous type being cast to isn't lossless when copied (e.g. casting an `int` to `bool`), the value stored in the buffer isn't sufficient and the underlying object needs to be reinterpreted again. This patch checks that the stored type is consistent with the requested return type, and triggers the recasting if not.
合并状态:未合并 关闭于 2025-06-09 1 条评论