refcount/__init__.py
def sub(self, value):
        """
        Subtract from a reference count

        >>> from refcount import Refcounter
        >>> ref = Refcounter(usecount=3)
        >>> ref.usecount
        3
        >>> ref.sub(2)
        >>> ref.usecount
        1

        If the reference count drops to 0, the release callback (if provided) will be automatically triggered.

        :param value: Amount to subtract
        :type value: int
        :raises UnderflowException: refcount underflow
        """
        if self._usecount - value < 0:
            raise UnderflowException('refcount underflow')

        self._usecount -= value

        if self._usecount == 0 and self._release is not None:
            self._release()

        Subtract from a reference count

        >>> from refcount import Refcounter
        >>> ref = Refcounter(usecount=3)
        >>> ref.usecount
        3
        >>> ref.sub(2)
        >>> ref.usecount
        1

        If the reference count drops to 0, the release callback (if provided) will be automatically triggered.

        :param value: Amount to subtract
        :type value: int
        :raises UnderflowException: refcount underflow
        


If the reference count drops to 0, the release callback (if provided) will be automatically triggered.
If the reference count drops to 0 the release callback ( if provided ) will be automatically triggered .
def sub(self, value):
        if self._usecount - value < 0:
            raise UnderflowException('refcount underflow')
        self._usecount -= value
        if self._usecount == 0 and self._release is not None:
            self._release()
def sub ( self , value ) : if self . _usecount - value < 0 : raise UnderflowException ( 'refcount underflow' ) self . _usecount -= value if self . _usecount == 0 and self . _release is not None : self . _release ( )
Subtract from a reference count
>>> from refcount import Refcounter
>>> ref = Refcounter(usecount=3)
>>> ref.usecount
3
>>> ref.sub(2)
>>> ref.usecount
1
Subtract from a reference count >>> from refcount import Refcounter >>> ref = Refcounter ( usecount = 3 ) >>> ref . usecount 3 >>> ref . sub ( 2 ) >>> ref . usecount 1
"""
        Subtract from a reference count

        >>> from refcount import Refcounter
        >>> ref = Refcounter(usecount=3)
        >>> ref.usecount
        3
        >>> ref.sub(2)
        >>> ref.usecount
        1

        If the reference count drops to 0, the release callback (if provided) will be automatically triggered.

        :param value: Amount to subtract
        :type value: int
        :raises UnderflowException: refcount underflow
        """
None
UnderflowException
self
value
Amount to subtract
Amount to subtract