Did I find the right examples for you? yes no

All Samples(32)  |  Call(30)  |  Derive(0)  |  Import(2)
Represents a basic subset object.

We generate subsets using essentially two techniques,
binary enumeration and lexicographic enumeration.
The Subset class takes two arguments, the first one
describes the initial subset to consider and the second
describes the superset.

Examples
========(more...)

src/s/y/sympy-HEAD/sympy/combinatorics/tests/test_subsets.py   sympy(Download)
from sympy.combinatorics import Subset
 
 
def test_subset():
    a = Subset(['c', 'd'], ['a', 'b', 'c', 'd'])
    assert a.next_binary() == Subset(['b'], ['a', 'b', 'c', 'd'])
    assert a.prev_binary() == Subset(['c'], ['a', 'b', 'c', 'd'])
    assert a.next_lexicographic() == Subset(['d'], ['a', 'b', 'c', 'd'])

src/s/y/sympy-0.7.5/sympy/combinatorics/tests/test_subsets.py   sympy(Download)
from sympy.combinatorics import Subset
 
 
def test_subset():
    a = Subset(['c', 'd'], ['a', 'b', 'c', 'd'])
    assert a.next_binary() == Subset(['b'], ['a', 'b', 'c', 'd'])
    assert a.prev_binary() == Subset(['c'], ['a', 'b', 'c', 'd'])
    assert a.next_lexicographic() == Subset(['d'], ['a', 'b', 'c', 'd'])