Ñò
ÎÑAHc           @   sA   d  g Z  d d k l Z l Z e e f Z d „  Z d „  Z d S(   t   genericiÿÿÿÿ(   t	   ClassTypet   InstanceTypec            s  t  ƒ  ‰  ‡  ‡ ‡ f d †  } h ˆ t  6| t 6‰ ˆ i ‰ ‡ ‡ f d †  } h  ‰ ˆ i ‰ ‡ ‡ f d †  } ‡  ‡ ‡ ‡ f d †  } y ˆ i | _ Wn t j
 o n Xˆ i i ƒ  | _ ˆ i | _ ˆ i | _ | | _	 | | _
 ˆ | _ ‡ f d †  | _ ‡ f d †  | _ | S(   s    Create a simple generic functionc             sq   |  d i  } x] t | i | t f h  ƒ i D]0 } ˆ | ˆ  ƒ } | ˆ  j	 o | |  | Ž  Sq, Wˆ |  | Ž  Sd  S(   Ni    (   t	   __class__t   typet   __name__t   objectt   __mro__(   t   argst   kwt   clst   tt   f(   t	   _sentinelt   funct   _gbt(    sV   /u/d/b/dbachman/web/work/lib/python2.3/site-packages/IPython/external/simplegeneric.pyt	   _by_class   s     c            s@   t  ˆ  t ƒ p t d ˆ  f ƒ ‚ n ‡ ‡  ‡ f d †  } | S(   s:   Decorator to add a method that will be called for type `t`s   %r is not a type or classc            s7   ˆ  i  ˆ |  ƒ |  j	 o t d ˆ ˆ f ƒ ‚ n |  S(   Ns!   %r already has method for type %r(   t
   setdefaultt	   TypeError(   R   (   t   _by_typeR   R   (    sV   /u/d/b/dbachman/web/work/lib/python2.3/site-packages/IPython/external/simplegeneric.pyt   decorate*   s    (   t
   isinstancet
   classtypesR   (   R   R   (   R   R   (   R   sV   /u/d/b/dbachman/web/work/lib/python2.3/site-packages/IPython/external/simplegeneric.pyt	   when_type$   s
    c            s   ‡ ‡  ‡ f d †  } | S(   s<   Decorator to add a method that will be called for object `o`c            sG   ˆ  i  t ˆ ƒ ˆ |  f ƒ d |  j	 o t d ˆ ˆ f ƒ ‚ n |  S(   Ni   s#   %r already has method for object %r(   R   t   idR   (   R   (   t
   _by_objectt   oR   (    sV   /u/d/b/dbachman/web/work/lib/python2.3/site-packages/IPython/external/simplegeneric.pyR   <   s    )(    (   R   R   (   R   R   (   R   sV   /u/d/b/dbachman/web/work/lib/python2.3/site-packages/IPython/external/simplegeneric.pyt   when_object:   s    c             s”   ˆ t  |  d ƒ ˆ  ƒ } | ˆ  j oY xg t |  d ƒ i D]0 } ˆ | ˆ  ƒ } | ˆ  j	 o | |  | Ž  Sq: Wˆ |  | Ž  Sn | d |  | Ž  Sd  S(   Ni    i   (   R   R   R   (   R   R	   R   R   (   R   t   _gboR   R   (    sV   /u/d/b/dbachman/web/work/lib/python2.3/site-packages/IPython/external/simplegeneric.pyt   dispatchE   s     c            s   t  |  ƒ ˆ  j S(    (   R   (   R   (   R   (    sV   /u/d/b/dbachman/web/work/lib/python2.3/site-packages/IPython/external/simplegeneric.pyt   <lambda>\   s    c            s
   |  ˆ  j S(    (    (   R   (   R   (    sV   /u/d/b/dbachman/web/work/lib/python2.3/site-packages/IPython/external/simplegeneric.pyR   ]   s    (   R   R   t   getR   R   t   __dict__t   copyt   __doc__t
   __module__R   R   t   defaultt
   has_objectt   has_type(   R   R   R   R   R   (    (   R   R   R   R   R   R   sV   /u/d/b/dbachman/web/work/lib/python2.3/site-packages/IPython/external/simplegeneric.pyR       s,    							c          C   s)   d d  k  }  |  i d d |  i |  i BƒS(   Niÿÿÿÿs
   README.txtt   optionflags(   t   doctestt   DocFileSuitet   ELLIPSISt   REPORT_ONLY_FIRST_FAILURE(   R(   (    (    sV   /u/d/b/dbachman/web/work/lib/python2.3/site-packages/IPython/external/simplegeneric.pyt
   test_suitec   s    N(   t   __all__t   typesR   R   R   R   R    R,   (    (    (    sV   /u/d/b/dbachman/web/work/lib/python2.3/site-packages/IPython/external/simplegeneric.pyt   <module>   s   		P