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

grammar enumeration requires Meaning to be hashable, but we allow referents to be a list #26

Closed
nathimel opened this issue Feb 3, 2024 · 1 comment
Assignees

Comments

@nathimel
Copy link
Collaborator

nathimel commented Feb 3, 2024

Small thing that I will fix myself, but documenting here anyways. In general I feel like we should have more guardrails against this kind of thing in the grammar enumeration code.

Nowhere in Meaning is it required to pass referents as a tuple, and it is not converted to one:
https://github.com/CLMBRs/ultk/blob/main/src/ultk/language/semantics.py#L133

But in grammar enumeration, and probably elsewhere, we assume Meaning is hashable. Since Meaning is now a dataclass, we should require referents to be a tuple.

https://github.com/CLMBRs/ultk/blob/main/src/ultk/language/grammar.py#L316

@nathimel nathimel self-assigned this Feb 4, 2024
@nathimel
Copy link
Collaborator Author

nathimel commented Feb 4, 2024

My first pass is going to be just to raise an error if anything other than a tuple of referents is passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant