-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/bzrlib/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/bzrlib/intset.pyc

๓
ฆ๎Nc@@s*ddlmZdefd„ƒYZdS(i(tabsolute_importtIntSetcB@s’eZdZdgZddd„Zd„Zd„Zd„Zd„Z	d„Z
d	„Zd
„Zd„Z
d„Zd
„Zd„Zd„ZRS(syFaster set-like class storing only whole numbers.

    Despite the name this stores long integers happily, but negative
    values are not allowed.

    >>> a = IntSet([0, 2, 5])
    >>> bool(a)
    True
    >>> 2 in a
    True
    >>> 4 in a
    False
    >>> a.add(4)
    >>> 4 in a
    True

    >>> b = IntSet()
    >>> not b
    True
    >>> b.add(10)
    >>> 10 in a
    False
    >>> a.update(b)
    >>> 10 in a
    True
    >>> a.update(range(5))
    >>> 3 in a
    True

    Being a set, duplicates are ignored:
    >>> a = IntSet()
    >>> a.add(10)
    >>> a.add(10)
    >>> 10 in a
    True
    >>> list(a)
    [10]

    t_vallcC@s)||_|dk	r%|j|ƒndS(shCreate a new intset.

        values
            If specified, an initial collection of values.
        N(RtNonetupdate(tselftvaluestbitmask((s1/usr/lib/python2.7/dist-packages/bzrlib/intset.pyt__init__Es	cC@s
t|jƒS(sŠIntSets are false if empty, otherwise True.

        >>> bool(IntSet())
        False

        >>> bool(IntSet([0]))
        True
        (tboolR(R((s1/usr/lib/python2.7/dist-packages/bzrlib/intset.pyt__nonzero__Ps	cC@sA|j}d}x+|r<|d@r/|d7}n|d?}qW|S(sYNumber of elements in set.

        >>> len(IntSet(xrange(20000)))
        20000
        ii(R(Rtvtc((s1/usr/lib/python2.7/dist-packages/bzrlib/intset.pyt__len__\s		

cC@s;t|tƒs$tt|ƒƒ‚ntd|j|j@ƒS(s฿Set intersection.

        >>> a = IntSet(range(10))
        >>> len(a)
        10
        >>> b = a & a
        >>> b == a
        True
        >>> a = a & IntSet([5, 7, 11, 13])
        >>> list(a)
        [5, 7]
        R(t
isinstanceRtNotImplementedErrorttypeR(Rtother((s1/usr/lib/python2.7/dist-packages/bzrlib/intset.pyt__and__ks
cC@s;t|tƒs$tt|ƒƒ‚ntd|j|jBƒS(sjSet union.

        >>> a = IntSet(range(10)) | IntSet([5, 15, 25])
        >>> len(a)
        12
        R(RRRRR(RR((s1/usr/lib/python2.7/dist-packages/bzrlib/intset.pyt__or__}scC@s't|tƒr|j|jkStSdS(sTComparison.

        >>> IntSet(range(3)) == IntSet([2, 0, 1])
        True
        N(RRRtFalse(RR((s1/usr/lib/python2.7/dist-packages/bzrlib/intset.pyt__eq__‰scC@s|j|ƒS(N(R(RR((s1/usr/lib/python2.7/dist-packages/bzrlib/intset.pyt__ne__•scC@s|jd|>@S(Nl(R(Rti((s1/usr/lib/python2.7/dist-packages/bzrlib/intset.pyt__contains__™scc@sF|j}d}x0|rA|d@r*|Vn|d?}|d}qWdS(sƒReturn contents of set.

        >>> list(IntSet())
        []
        >>> list(IntSet([0, 1, 5, 7]))
        [0, 1, 5, 7]
        iiN(R(RRto((s1/usr/lib/python2.7/dist-packages/bzrlib/intset.pyt__iter__s		

cC@sLt|tƒr$|j|jO_n$x!|D]}|jd|>O_q+WdS(s5Add all the values from the sequence or intset to_addlN(RRR(Rtto_addR((s1/usr/lib/python2.7/dist-packages/bzrlib/intset.pyRฏs
cC@s|jd|>O_dS(Nl(R(RR((s1/usr/lib/python2.7/dist-packages/bzrlib/intset.pytaddธscC@s9d|>}|j|@s&t|ƒ‚n|j|N_dS(sิRemove one value from the set.

        Raises KeyError if the value is not present.

        >>> a = IntSet([10])
        >>> a.remove(9)
        Traceback (most recent call last):
          File "/usr/lib/python2.4/doctest.py", line 1243, in __run
            compileflags, 1) in test.globs
          File "<doctest __main__.IntSet.remove[1]>", line 1, in ?
            a.remove(9)
        KeyError: 9
        >>> a.remove(10)
        >>> not a
        True
        lN(RtKeyError(Rt	to_removetm((s1/usr/lib/python2.7/dist-packages/bzrlib/intset.pytremoveผs

cC@sIt|tƒs&|jt|ƒƒdS|j|j@}|j|N_dS(sRemove all values that exist in to_remove.

        >>> a = IntSet(range(10))
        >>> b = IntSet([2,3,4,7,12])
        >>> a.set_remove(b)
        >>> list(a)
        [0, 1, 5, 6, 8, 9]
        >>> a.set_remove([1,2,5])
        >>> list(a)
        [0, 6, 8, 9]
        N(RRt
set_removeR(RRt	intersect((s1/usr/lib/python2.7/dist-packages/bzrlib/intset.pyR!าs
N(t__name__t
__module__t__doc__t	__slots__RRR
R
RRRRRRRRR R!(((s1/usr/lib/python2.7/dist-packages/bzrlib/intset.pyRs'													N(t
__future__Rt	ExceptionR(((s1/usr/lib/python2.7/dist-packages/bzrlib/intset.pyt<module>s

Copyright © 2017 || Recoded By Mr.Bumblebee