Skip to content

Require hashables for sequences.* unique functions #116

Description

@ferringb

The current code has an explicit fallback that uses a list for unhashable items, which is a quadratic search for unhashable N. Not awesome, in short, but a byproduct of the compatibility shit snakeoil dealt with from py2k old/new style and then py3k adding the punch in the face.

My rough thought is to initially make this API typed as require Hashable, but don't change the algorithm. Depending on what mypy finds- how much of a pain in the ass this is to fix- if needed, add a hash_func=Callable[[Any], hashable] schwartzian transform callable.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions