[mypyc] Improve support for frozenset#18571
Conversation
JukkaL
left a comment
There was a problem hiding this comment.
Thanks! Frozensets are likely be used in performance critical code, so having better support for them is helpful. Left a few minor comments, overall looks good.
| @@ -0,0 +1,536 @@ | |||
| [case testNewFrozenSet] | |||
There was a problem hiding this comment.
The irbuild tests are maybe too verbose -- they may need to be updated frequently as the details of emitter IR change. My suggestion would be to avoid some duplication and to move some thing to run tests if they don't otherwise have test coverage.
There was a problem hiding this comment.
Tbh for the first implementation I mostly copied the set test cases and adjusted them slightly for frozenset. Your suggestion does make sense though. Moved some of the fromIterable tests to run_sets.test.
There was a problem hiding this comment.
Yeah some of the existing IR build tests are overly verbose.
1d2a393 to
8edec05
Compare
Add optimized methods for `len` and `contains` on `frozenset` objects.
Add optimized methods for
lenandcontainsonfrozensetobjects.