(cls, subset, superset)
return obj
Default constructor.

        It takes the subset and its superset as its parameters.

        Examples
        ========

        >>> from sympy.combinatorics.subsets import Subset
        >>> a = Subset(['c','d'], ['a','b','c','d'])
        >>> a.subset
        ['c', 'd']
        >>> a.superset
        ['a', 'b', 'c', 'd']
        >>> a.size
        2
Default constructor.
Default constructor .
def __new__(cls, subset, superset):
        """
        Default constructor.

        It takes the subset and its superset as its parameters.

        Examples
        ========

        >>> from sympy.combinatorics.subsets import Subset
        >>> a = Subset(['c','d'], ['a','b','c','d'])
        >>> a.subset
        ['c', 'd']
        >>> a.superset
        ['a', 'b', 'c', 'd']
        >>> a.size
        2
        """
        if len(subset) > len(superset):
            raise ValueError('Invalid arguments have been provided. The superset must be larger than the subset.')
        for elem in subset:
            if elem not in superset:
                raise ValueError('The superset provided is invalid as it does not contain the element %i' % elem)
        obj = Basic.__new__(cls)
        obj._subset = subset
        obj._superset = superset
        return obj
def __new__ ( cls , subset , superset ) : if len ( subset ) > len ( superset ) : raise ValueError ( 'Invalid arguments have been provided. The superset must be larger than the subset.' ) for elem in subset : if elem not in superset : raise ValueError ( 'The superset provided is invalid as it does not contain the element %i' % elem ) obj = Basic . __new__ ( cls ) obj . _subset = subset obj . _superset = superset return obj