Changeset 1174

Show
Ignore:
Timestamp:
03/26/07 23:20:19 (2 years ago)
Author:
arj..@yirdis.nl
Message:

do not raise exception when constraints are removed from solver more than once

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gaphas/trunk/gaphas/solver.py

    r1162 r1174  
    364364        EquationConstraint(<lambda>, a=Variable(0, 20), b=Variable(2, 20)) 
    365365        >>> s.remove_constraint(c) 
     366 
     367        Removing a constraint twice has no effect: 
     368        >>> s.remove_constraint(c) 
     369 
    366370        """ 
    367371        for v in constraint.variables(): 
    368             v._constraints.remove(constraint) 
     372            v._constraints.discard(constraint) 
    369373        self._constraints.discard(constraint) 
    370374        if constraint in self._marked_cons: 
  • gaphas/trunk/undo.txt

    r1162 r1174  
    254254    (10, 10) 
    255255     
     256    >>> canvas = Canvas() 
     257    >>> e.canvas = canvas 
     258    >>> undo() 
     259    >>> e.canvas 
    256260 
    257261item.py: Line