typed_python icon indicating copy to clipboard operation
typed_python copied to clipboard

Implement full ConstDict model in compiler

Open braxtonmckee opened this issue 4 years ago • 1 comments

Right now, we have an incomplete implementation that doesn't actually let you do much with const dicts. We should implement the full set of semantics, including adding, converting from typed things like Dict(T1, T2), etc.

Also, we should probably implement the formal tree model for it, because right now lots of standard operations in the interpreter are quite slow if the dicts get large.

braxtonmckee avatar Oct 03 '20 18:10 braxtonmckee

I see that the "+" operator is implemented for ConstDict, but it looks like this will be the "|" operator as of Python 3.9. Other missing operations: d.copy() d.fromkeys() reversed(d) [for 3.8] Besides converting Dict(T1,T2) -> ConstDict(T3,T4), I think that's all the missing operations.

[Regarding Dict: The "+" operator is not implemented for Dict, but when we do implement it, it should be the "|" operator as of Python 3.9. The Dict implementation is also currently missing copy, fromkeys, and reversed support.]

rubidge avatar Dec 01 '20 17:12 rubidge