-
Notifications
You must be signed in to change notification settings - Fork 162
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
Improve support for custom list object implementations #2985
Improve support for custom list object implementations #2985
Conversation
6cd1646
to
f6e7a8e
Compare
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.
In one of the commit messages, change tnum value,T_INT , but
to tnum value, T_INT, but
63f1720
to
590760d
Compare
Fixes made. I'm sure a more complete overhall of lots of list based stuff could be made (and reading comments in the source, many things were never finished in the first place), but this adds enough functionality for many basic cases, including the cases I want to work. |
Codecov Report
@@ Coverage Diff @@
## master #2985 +/- ##
==========================================
+ Coverage 85.21% 85.24% +0.02%
==========================================
Files 110 110
Lines 56857 56877 +20
==========================================
+ Hits 48450 48482 +32
+ Misses 8407 8395 -12
|
Make the _FILT_LIST functions be a no-op when the FiltList they use is 0, so they can be safely called on non-list types. 0 is the default value used for the FiltLists. It is also a valid tnum value, T_INT, but it would never make sense for one of the *_FILT_LIST functions to turn something into a T_INT.
7fc95fe
to
50dcc7d
Compare
This has long been the case for plists, this adds support for lists which are not plists to also be non-homogenous and strictly sorted.
This was already allowed in Sort. While Sort and ParallelSort both fail with an error if given a non-dense lists, there can exists lists which are dense but do not have the filter IsDenseList
50dcc7d
to
d4f61c5
Compare
This is a selection of fixes which I came up with while trying to implement an object which acts as a mutable list.
SortParallel requires IsDenseList. Sort and SortBy only require IsList and work fine, so unify with them.
IsSSortedList requires the list is homogenous. In the distant past this was required for all lists, and then the requirement was removed for plists, without removing it for plists.
Make sure we don't call _FILT_LIST on non-plists. To be honest I'm not totally happy with this and considered rewriting this bit of code to make it less fragile, but decided I didn't want to go down that rabbithole. This certainly makes things better than they were.