Changeset 2820


Ignore:
Timestamp:
Jul 20, 2010 1:30:14 PM (9 years ago)
Author:
prsteel
Message:

Small change to Set.eq method. Was failing on non-set comparisons; i.e., Set() == 1.0 raised an error rather than returning False.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.pyomo/trunk/coopr/pyomo/base/sets.py

    r2812 r2820  
    519519    def __eq__(self,other):
    520520        """ Equality comparison """
    521         tmp = self._set_repn(other)
     521        try:
     522            tmp = self._set_repn(other)
     523        except TypeError:
     524            # An exception is raised if a non-set object is passed to _set_repn
     525            return False
    522526        if self.virtual:
    523527            if other.virtual:
Note: See TracChangeset for help on using the changeset viewer.