ITADN

i128 / u128: serialisation returns Err with no documentation of the limitation

#112Openleftygbalogh 创建于 2026-04-05
L
leftygbaloghcommented
## Summary Apologies for taking up your time - I do hope this is useful rather than a bother. While working on an extended test suite for `pythonize` (see PRs #108-#110), I noticed that attempting to serialise a Rust `i128` or `u128` value produces an `Err` at runtime, but this limitation does not appear to be documented anywhere in the README, API docs, or inline comments. ## Reproduction ```rust Python::attach(|py| { let val: i128 = 1; let result = pythonize(py, &val); // returns Err println!("{:?}", result); }); ``` ## Expected behaviour Either a clear error at serialisation time is fine (Python's `int` can represent arbitrary integers, so a conversion *could* in principle be supported), or -- if the limitation is intentional -- a note in the README type-mapping table would save users a rather puzzling debugging session. ## Suggested addition (no code required) A single line in the README type table noting that `i128` / `u128` are not currently supported would be perfectly sufficient. I would be very happy to include such a note in one of the open test PRs if that would be convenient. Many thanks for maintaining this crate -- it is a genuinely useful piece of work.
0 条评论