Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can (anonymous) tuples implement hashable automatically #2042

Open
plajjan opened this issue Dec 23, 2024 · 1 comment
Open

Can (anonymous) tuples implement hashable automatically #2042

plajjan opened this issue Dec 23, 2024 · 1 comment
Labels
builtins Related to builtins enhancement New feature or request

Comments

@plajjan
Copy link
Contributor

plajjan commented Dec 23, 2024

It feels like tuples should be hashable when when they consist of fields that are hashable individually.

I think this requires #1677

@plajjan plajjan added enhancement New feature or request builtins Related to builtins labels Dec 23, 2024
@nordlander
Copy link
Contributor

The catch is that our type system doesn't yet allow us to express an arbitrary tuple where every component is Hashable. This is something we want, though, not just for Hashable but for "Printable", "Serializable" and all such protocols in the pipe, as well as the subtree notion I'm seeing around the next corner for Orchestron.

Let's call the desired feature regular tuples! My hope is that they will be as flexible as Python's common use of dict[str,object] data, while supporting static type-safety.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builtins Related to builtins enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants