Skip to content

Deserializing ints of arbitrary size or signedness #25

@ExpHP

Description

@ExpHP

Even though I decided against automatic widening conversions due to implementation complexity, we could still have types that allow deserializing multiple different choices for signedness or size:

// these wrappers will implement Deserialize, but not Serialize.
pub struct Int(pub i128);
pub struct SignedInt(pub i64);
pub struct UnsignedInt(pub u64);

This is important to have because, for instance, sparse array .npz files automatically switch between using <i4 and <i8 based on the data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions