Skip to content

implement Hash on tuples and owned containers #5195

Closed
@thestinger

Description

@thestinger

This is definitely important for tuples (similar to how they implement Ord), but I think an IterBytes implementation would be strange, so they would probably have to use SipHash directly.

Hash can also be implemented for freezable containers like vectors, maps and sets. In Python this is a very common idiom and they actually have a frozenset type for this use case, and it's the main reason Python has tuples (which in Python are just immutable lists).

Ideally there would be one implementation of combining hashes and it can be reused. I'm not entirely sure how such a thing would be implemented correctly though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions