MINI MINI MANI MO
ó
i:Oc @ sB d Z d d l Z d d l m Z d e f d „ ƒ YZ d Z d S( s
-----------
defaultdict
-----------
This is a pure python implementation of defaultdict that is compatible with
the defaultdict class provided by python-2.5 and above.
.. seealso::
:class:`collections.defaultdict`
for documentation on this module
iÿÿÿÿN( t b_t defaultdictc B sS e Z d d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z
RS( c O sQ | d k r1 t | d ƒ r1 t t d ƒ ƒ ‚ n t j | | | Ž | | _ d S( Nt __call__s First argument must be callable( t Nonet hasattrt TypeErrorR t dictt __init__t default_factory( t selfR t argst kwargs( ( sO /usr/lib/python2.7/site-packages/kitchen/pycompat25/collections/_defaultdict.pyR Z s
c C s6 y t j | | ƒ SWn t k
r1 | j | ƒ SXd S( N( R t __getitem__t KeyErrort __missing__( R t key( ( sO /usr/lib/python2.7/site-packages/kitchen/pycompat25/collections/_defaultdict.pyR a s
c C s6 | j d k r t | ƒ ‚ n | j ƒ | | <} | S( N( R R R
( R R t value( ( sO /usr/lib/python2.7/site-packages/kitchen/pycompat25/collections/_defaultdict.pyR g s c C sF | j d k r t ƒ } n | j f } t | ƒ | d d | j ƒ f S( N( R R t tuplet typet iteritems( R R
( ( sO /usr/lib/python2.7/site-packages/kitchen/pycompat25/collections/_defaultdict.pyt
__reduce__m s c C s
| j ƒ S( N( t __copy__( R ( ( sO /usr/lib/python2.7/site-packages/kitchen/pycompat25/collections/_defaultdict.pyt copyt s c C s t | ƒ | j | ƒ S( N( R R ( R ( ( sO /usr/lib/python2.7/site-packages/kitchen/pycompat25/collections/_defaultdict.pyR w s c C s1 d d l } t | ƒ | j | j | j ƒ ƒ ƒ S( Niÿÿÿÿ( R R R t deepcopyt items( R t memoR ( ( sO /usr/lib/python2.7/site-packages/kitchen/pycompat25/collections/_defaultdict.pyt __deepcopy__z s c C sk t | j t j ƒ rE | j j d k rE t | j j t ƒ rE d } n t | j ƒ } d | t
j | ƒ f S( Ns- <bound method sub._factory of defaultdict(...s defaultdict(%s, %s)( t
isinstanceR t typest
MethodTypet im_selfR t
issubclasst im_classR t reprR t __repr__( R t defrepr( ( sO /usr/lib/python2.7/site-packages/kitchen/pycompat25/collections/_defaultdict.pyR"