Ñò
mÈKc           @   s?   d  Z  d „  Z d e f d „  ƒ  YZ d e f d „  ƒ  YZ d S(   s3   Abstract Base Classes (ABCs) according to PEP 3119.c         C   s   t  |  _ |  S(   sï  A decorator indicating abstract methods.

    Requires that the metaclass is ABCMeta or derived from it.  A
    class that has a metaclass derived from ABCMeta cannot be
    instantiated unless all of its abstract methods are overridden.
    The abstract methods can be called using any of the normal
    'super' call mechanisms.

    Usage:

        class C:
            __metaclass__ = ABCMeta
            @abstractmethod
            def my_abstract_method(self, ...):
                ...
    (   t   Truet   __isabstractmethod__(   t   funcobj(    (    s   /usr/lib/python2.6/abc.pyt   abstractmethod   s    	t   abstractpropertyc           B   s   e  Z d  Z e Z RS(   s/  A decorator indicating abstract properties.

    Requires that the metaclass is ABCMeta or derived from it.  A
    class that has a metaclass derived from ABCMeta cannot be
    instantiated unless all of its abstract properties are overridden.
    The abstract properties can be called using any of the normal
    'super' call mechanisms.

    Usage:

        class C:
            __metaclass__ = ABCMeta
            @abstractproperty
            def my_abstract_property(self):
                ...

    This defines a read-only property; you can also define a read-write
    abstract property using the 'long' form of property declaration:

        class C:
            __metaclass__ = ABCMeta
            def getx(self): ...
            def setx(self, value): ...
            x = abstractproperty(getx, setx)
    (   t   __name__t
   __module__t   __doc__R    R   (    (    (    s   /usr/lib/python2.6/abc.pyR      s   t   ABCMetac           B   sD   e  Z d  Z d Z d „  Z d „  Z d d „ Z d „  Z d „  Z	 RS(   si  Metaclass for defining Abstract Base Classes (ABCs).

    Use this metaclass to create an ABC.  An ABC can be subclassed
    directly, and then acts as a mix-in class.  You can also register
    unrelated concrete classes (even built-in classes) and unrelated
    ABCs as 'virtual subclasses' -- these and their descendants will
    be considered subclasses of the registering ABC by the built-in
    issubclass() function, but the registering ABC won't show up in
    their MRO (Method Resolution Order) nor will method
    implementations defined by the registering ABC be callable (not
    even via super()).

    i    c         C   sç   t  t |  ƒ i |  | | | ƒ } t d „  | i ƒ  Dƒ ƒ } xd | D]\ } xS t | d t ƒ  ƒ D]< } t | | d  ƒ } t | d t ƒ o | i | ƒ q` q` WqD Wt	 | ƒ | _
 t ƒ  | _ t ƒ  | _ t ƒ  | _ t i | _ | S(   Nc         s   s6   x/ |  ]( \ } } t  | d  t ƒ o	 | Vq q Wd S(   R   N(   t   getattrt   False(   t   .0t   namet   value(    (    s   /usr/lib/python2.6/abc.pys	   <genexpr>Q   s   		t   __abstractmethods__R   (   t   superR   t   __new__t   sett   itemsR	   t   NoneR
   t   addt	   frozensetR   t   _abc_registryt
   _abc_cachet   _abc_negative_cachet   _abc_invalidation_countert   _abc_negative_cache_version(   t   mclsR   t   basest	   namespacet   clst	   abstractst   baseR   (    (    s   /usr/lib/python2.6/abc.pyR   N   s     !	  c         C   sx   t  |  t ƒ p t d ƒ ‚ n t | |  ƒ o d St |  | ƒ o t d ƒ ‚ n |  i i | ƒ t i d 7_ d S(   s&   Register a virtual subclass of an ABC.s   Can only register classesNs'   Refusing to create an inheritance cyclei   (	   t
   isinstancet   typet	   TypeErrort
   issubclasst   RuntimeErrorR   R   R   R   (   R   t   subclass(    (    s   /usr/lib/python2.6/abc.pyt   registera   s    c         C   s†   | d |  i  |  i f IJ| d t i IJxT t |  i i ƒ  ƒ D]= } | i d ƒ o' t |  | ƒ } | d | | f IJqA qA Wd S(   s'   Debug helper to print the ABC registry.s   Class: %s.%ss   Inv.counter: %st   _abc_s   %s: %rN(	   R   R   R   R   t   sortedt   __dict__t   keyst
   startswithR	   (   R   t   fileR   R   (    (    s   /usr/lib/python2.6/abc.pyt   _dump_registryo   s     c         C   s    t  | d d ƒ } | |  i j o t St | ƒ } | | j p | d j o6 |  i t i j o | |  i j o t	 S|  i
 | ƒ S|  i
 | ƒ p |  i
 | ƒ S(   s'   Override for isinstance(instance, cls).t	   __class__N(   R	   R   R   R    R"   R   R   R   R   R
   t   __subclasscheck__(   R   t   instanceR&   t   subtype(    (    s   /usr/lib/python2.6/abc.pyt   __instancecheck__x   s    c         C   ss  | |  i  j o t S|  i t i j  o t ƒ  |  _ t i |  _ n | |  i j o t S|  i | ƒ } | t	 j	 oG t
 | t ƒ p t ‚ | o |  i  i | ƒ n |  i i | ƒ | S|  t | d d ƒ j o |  i  i | ƒ t Sx6 |  i D]+ } t | | ƒ o |  i  i | ƒ t Sqô Wx9 |  i ƒ  D]+ } t | | ƒ o |  i  i | ƒ t Sq0W|  i i | ƒ t S(   s'   Override for issubclass(subclass, cls).t   __mro__(    (   R   R    R   R   R   R   R   R
   t   __subclasshook__t   NotImplementedR!   t   boolt   AssertionErrorR   R	   R   R$   t   __subclasses__(   R   R&   t   okt   rclst   scls(    (    s   /usr/lib/python2.6/abc.pyR0   ‰   s:    
 	 	N(
   R   R   R   R   R   R'   R   R.   R3   R0   (    (    (    s   /usr/lib/python2.6/abc.pyR   9   s   				N(   R   R   t   propertyR   R"   R   (    (    (    s   /usr/lib/python2.6/abc.pyt   <module>   s   	