Skip to content
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

Teach (iter)solve to take generic iterables of iterables as clauses argument #4

Merged
merged 7 commits into from
Nov 10, 2013

Conversation

wkschwartz
Copy link
Contributor

Previously, you could call solve (and itersolve implied by solve from here on out) only with a list of lists of ints. Alternatively you could call solve with an iterator of lists of ints. This pull request adds the ability to call solve with a generic iterable of iterables of ints, for example a tuple of generators of ints.

Tests for both solve and itersolve pass on Pythons 3.3.2 and 2.7.5 (using the patch from #5) on Mac OS with compiler Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) targeting x86_64-apple-darwin12.5.0. I don't have access to Windows or Linux.

This addresses issue #3.

…clauses

This reduces code redundancy in pycosat.c's add_clauses function.
According to the CPython API, PyObject_GetIter sets a TypeError without needing
it to be set again by the calling code.
Commit fdf54a8 taught them to accept the list
of lists that represented clauses as any iterable of lists. Now it can be any
iterable of any iterables.
ilanschnell added a commit that referenced this pull request Nov 10, 2013
Teach (iter)solve to take generic iterables of iterables as clauses argument
@ilanschnell ilanschnell merged commit 84fba48 into conda:master Nov 10, 2013
@github-actions
Copy link

Hi there, thank you for your contribution!

This pull request has been automatically locked because it has not had recent activity after being closed.

Please open a new issue or pull request if needed.

Thanks!

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Mar 21, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants