Ñò
*”æJc           @   s   d  e  f d „  ƒ  YZ d S(   t   IncDictc           B   s   e  Z d  Z d „  Z RS(   sÒ  
    For code where we update a count in a dictionary, we often need this
    kind of thing to avoid throwing an exception:

    d = {}
    try: d['a'] += 1
    except KeyError: d['a'] = 0 

    The IncDict class makes __getitem__ return 0 for any key that is
    not in the dictionary, and so we can do this instead:

    >>> d = IncDict()
    >>> print d
    {}
    >>> d['a'] += 1
    >>> print d
    {'a': 1}
    >>> d['a'] += 1
    >>> print d
    {'a': 2}
    c         C   s)   |  i  | ƒ o t i |  | ƒ Sd Sd  S(   Ni    (   t   has_keyt   dictt   __getitem__(   t   selft   y(    (    s
   incdict.pyR   )   s     (   t   __name__t
   __module__t   __doc__R   (    (    (    s
   incdict.pyR       s   N(   R   R    (    (    (    s
   incdict.pyt   <module>   s    
