-
Notifications
You must be signed in to change notification settings - Fork 2
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
module-level factory functions #24
Conversation
This is a start on #12 . A few notes:
|
@nicomitchell : can you add tests to this for the order check case of |
Another general comment on something that isn't in the diff so I can't leave a review: can we change Since it's effectively a private constructor, we can trust that the factory method is never sharing the iteration order with the caller, even if it is mutable. Current implementation is:
EDIT: The downside of this is that |
@ConstantineLignos : actually, is there any reason to have |
@ConstantineLignos : I think an event nicer option is for |
(but this should be checked using benchmarks) |
I'm fine with killing off (Just in case anyone is wondering, the Python 3.6 dict implementation keeps the order of first insertion as you might expect, just like
|
@ConstantineLignos : I experimented a little with using a
In increases the time to initialize from a 3-element collection by ~5% but doubles performance on a 10k-element collection, so I think it is a win. One challenge with using the |
@rgabbard Is there anything we'd need to do before merging if we stick with the frozenset backing right now? |
@ConstantineLignos : I have some local changes on this branch to sync up with this before merging. Poke me if I haven't taken care of it by tomorrow morning |
Sounds good. I'm on vacation at the start of next week so I'd like to get this and isi-vista/vistautils#44 sorted this week before I go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, one comment to remove. Also, I'm starting to think maybe we can just remove the type-checking features in favor of maybe adding some helpers to vistautils?
I'm all in favor of ditching the type checking (which I think also means, on a future PR, ditching |
e027933
to
21e9a02
Compare
Codecov Report
@@ Coverage Diff @@
## master #24 +/- ##
==========================================
- Coverage 91.82% 89.66% -2.17%
==========================================
Files 7 7
Lines 575 619 +44
==========================================
+ Hits 528 555 +27
- Misses 47 64 +17
Continue to review full report at Codecov.
|
I'm ignoring |
Partially addresses #12