You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 ofDict(int, H)
where H is some held class, thenf(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.
The text was updated successfully, but these errors were encountered: