~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/intset.py

  • Committer: Vincent Ladeuil
  • Date: 2012-03-09 16:48:55 UTC
  • mto: (6437.23.24 2.5)
  • mto: This revision was merged to the branch mainline in revision 6499.
  • Revision ID: v.ladeuil+lp@free.fr-20120309164855-htdn25hp7x65mmir
Rely on sphinx for texinfo doc generation

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
16
 
 
17
from __future__ import absolute_import
16
18
 
17
19
# Author: Martin Pool <mbp@canonical.com>
18
20
 
60
62
    True
61
63
    >>> list(a)
62
64
    [10]
63
 
    
 
65
 
64
66
    """
65
67
    __slots__ = ['_val']
66
68
 
80
82
 
81
83
        >>> bool(IntSet())
82
84
        False
83
 
        
 
85
 
84
86
        >>> bool(IntSet([0]))
85
87
        True
86
88
        """
129
131
        """
130
132
        if not isinstance(other, IntSet):
131
133
            raise NotImplementedError(type(other))
132
 
        return IntSet(bitmask=(self._val | other._val))        
 
134
        return IntSet(bitmask=(self._val | other._val))
133
135
 
134
136
 
135
137
    def __eq__(self, other):
169
171
            v = v >> 1
170
172
            o = o + 1
171
173
 
172
 
        
 
174
 
173
175
    def update(self, to_add):
174
176
        """Add all the values from the sequence or intset to_add"""
175
177
        if isinstance(to_add, IntSet):