Skip to content

UniqueRepresentation and hash value #8120

@hivert

Description

@hivert

The documentation of UniqueRepresentation says

    Similarly, the identity is used as hash function, which is also as
    fast as it can get. However this means that the hash function may
    change in between Sage sessions, or even within the same Sage
    session (see below). Subclasses should overload :meth:`__hash__`
    if this could be a problem.

But there is no implementation of __hash__.

I'm adding one.

CC: @zimmermann6 @nthiery

Component: algebra

Keywords: UniqueRepresentation hash

Author: Florent Hivert

Reviewer: Paul Zimmermann

Merged: sage-4.3.3.alpha0

Issue created by migration from https://trac.sagemath.org/ticket/8120

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions