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

Check that HeldClass and Dict/ConstDict semantics make sense. #423

Open
braxtonmckee opened this issue Jan 30, 2023 · 0 comments
Open

Check that HeldClass and Dict/ConstDict semantics make sense. #423

braxtonmckee opened this issue Jan 30, 2023 · 0 comments

Comments

@braxtonmckee
Copy link
Collaborator

braxtonmckee commented Jan 30, 2023

For instance, does it make sense for a ConstDict(T, H) to return a refto its values if the dict is supposed to be const? Are the compiler and interpreter treatments for Dict and ConstDict the same? Does dict.pop of a held class return a copy of the instance in both interpreter and compiler?

Also, there's a nasty bug that user code could have: d is an instance of Dict(int, H) where H is some held class, then f(d.setdefault(0), d.setdefault(1)) could segfault, because the temporary reference returned by the first setdefault could be invalidated by the second setdefault. How should we handle this?

Similarly, we need to make sure that Dict and Set don't expose their key internals in a way that could modify them and invalidate the internals of the data structure.

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