�
Ϫ�fu � � � G d � d� Z y)c �T � e Zd ZdZdZd
d�Zd� Zdedefd�Z dedefd �Z
d
� Zd� Zd� Z
y)�Counterz�a simple counter object for testing trial's doctest support
>>> c = Counter()
>>> c.value()
0
>>> c += 3
>>> c.value()
3
>>> c.incr()
>>> c.value() == 4
True
>>> c == 4
True
>>> c != 9
True
� Nc � � || _ || _ y )N)�_count�maxval)�self�initialValuer s �@/usr/lib/python3/dist-packages/twisted/trial/test/mockdoctest.py�__init__zCounter.__init__ s � �"������ c � � | j �'| j |z | j kD rt d� �| xj |z
c_ | S )z�add other to my value and return self
>>> c = Counter(100)
>>> c += 333
>>> c == 433
True
zsorry, counter got too big)r r �
ValueError�r �others r
�__iadd__zCounter.__iadd__! sA � � �;�;�"����u�)<����(K��9�:�:��K�K�5� �K��r r �returnc � � | j |k( S )z�equality operator, compare other to my value()
>>> c = Counter()
>>> c == 0
True
>>> c += 10
>>> c.incr()
>>> c == 10 # fail this test on purpose
True
�r r s r
�__eq__zCounter.__eq__/ s � � �{�{�e�#�#r c �& |