Conversation
ThomSerg
left a comment
There was a problem hiding this comment.
Looks good. But was wondering why we don't check if its an iterable instead? Something similar as is done in _flatten(). Not that this would make any noticeable difference. Just a thought, pull request can be merged as is.
|
Hmm good point, from a user-perspective it might actually be nice if we just took care of any collection. |
|
I'm not convinced... we should have stricter typing, not weaker? e.g. this should be a List[BoolVarImpl_] or smth... if a user has a set, they should just do list({a,b})? Or it can be any Iterable, but 'flatten' means also nested lists? |
|
Hmm yeah explicitly typing this might indeed be the better option, we should check for it as well then and raise a proper error |
|
I'd be in favor of an On one hand, this is weaker typing than having On the other hand, this typing is stronger b/c it does not accept iterators over non-literals: e.g. the iterable should be "flat" (only generate literals, not suddenly generate lists!), because it's not clear what this means. An assumption is a literal, not a list. |
|
Also note: in this PR, please also remove |
|
related to #775 |
|
right, so should be type hinted as Iterable and not Sequence because we don't care about the ordering... |
|
rebased, please review @IgnaceBleukx |
Allows a user to post a
setinstead oflistof assumption variables during the solve call.More of a user-experience improvement (personally also encountered this multiple times already) and fixes #689
Could be part of a larger discussion on what to do with sets in general, do we want to support them as if they were lists?
E.g., should
get_variables(some_set_of_constraints)also work?