Skip to content

Add Py_HashDouble() function #2

Closed
@vstinner

Description

@vstinner
  • PR: gh-111545: Add Py_HashDouble() function python/cpython#112449

  • API: int Py_HashDouble(double value, Py_hash_t *result)

    • Set *result to the hash value and return 1 on success.
    • Set *result to 0 and return 0 if the hash value cannot be calculated. For example, if value is not-a-number (NaN).
    • result must not be NULL
  • Stable ABI: compatible

  • Not added to the limited C API yet

UPDATE: I updated the API documation to address @zooba's suggestion (make the API more generic, be less specific about NaN case).

Voters:

Since I proposed this API and I'm part of the C API Working Group, I will not vote on this decision.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions