ó
çÇ7]c           @   sm   d  Z  d d l Z d d
 d „  ƒ  YZ e e ƒ  ƒ Z d „  Z d e f d „  ƒ  YZ d e f d	 „  ƒ  YZ d S(   s3   Abstract Base Classes (ABCs) according to PEP 3119.iÿÿÿÿNt   _Cc           B   s   e  Z RS(    (   t   __name__t
   __module__(    (    (    sE   /home/wilkie/singularity/occam/occam/init/python/lib/python2.7/abc.pyR    
   s    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(    (    sE   /home/wilkie/singularity/occam/occam/init/python/lib/python2.7/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)
    (   R   R   t   __doc__R   R   (    (    (    sE   /home/wilkie/singularity/occam/occam/init/python/lib/python2.7/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 |  ƒ j |  | | | ƒ } t d „  | j ƒ  Dƒ ƒ } xb | D]Z } xQ t | d t ƒ  ƒ D]: } t | | d  ƒ } t | d t ƒ r` | j | ƒ q` q` WqD Wt	 | ƒ | _
 t ƒ  | _ t ƒ  | _ t ƒ  | _ t j | _ | S(   Nc         s   s-   |  ]# \ } } t  | d  t ƒ r | Vq d S(   R   N(   t   getattrt   False(   t   .0t   namet   value(    (    sE   /home/wilkie/singularity/occam/occam/init/python/lib/python2.7/abc.pys	   <genexpr>X   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   (    (    sE   /home/wilkie/singularity/occam/occam/init/python/lib/python2.7/abc.pyR   U   s    !	c         C   s{   t  | t t j f ƒ s' t d ƒ ‚ n  t | |  ƒ r: d St |  | ƒ rX t d ƒ ‚ n  |  j j | ƒ t	 j
 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   typest	   ClassTypet	   TypeErrort
   issubclasst   RuntimeErrorR   R   R	   R   (   R   t   subclass(    (    sE   /home/wilkie/singularity/occam/occam/init/python/lib/python2.7/abc.pyt   registerh   s    c         C   s„   | d |  j  |  j f IJ| d t j IJxR t |  j j ƒ  ƒ D]; } | j d ƒ rA 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   (    (    sE   /home/wilkie/singularity/occam/occam/init/python/lib/python2.7/abc.pyt   _dump_registryv   s    c         C   s¬   t  | d d ƒ } | |  j k r% t St | ƒ } | t k rF | } n  | | k s^ | d k r |  j t j k rƒ | |  j	 k rƒ t
 S|  j | ƒ S|  j | ƒ p« |  j | ƒ S(   s'   Override for isinstance(instance, cls).t	   __class__N(   R
   R   R   R   R#   t   _InstanceTypeR   R	   R   R   R   t   __subclasscheck__(   R   t   instanceR)   t   subtype(    (    sE   /home/wilkie/singularity/occam/occam/init/python/lib/python2.7/abc.pyt   __instancecheck__   s    	c         C   sa  | |  j  k r t S|  j t j k  r@ t ƒ  |  _ t j |  _ n | |  j k rS t S|  j | ƒ } | t	 k	 r° t
 | t ƒ sƒ t ‚ | rœ |  j  j | ƒ n |  j j | ƒ | S|  t | d d ƒ k rÜ |  j  j | ƒ t Sx4 |  j D]) } t | | ƒ ræ |  j  j | ƒ t Sqæ Wx7 |  j ƒ  D]) } t | | ƒ r |  j  j | ƒ t Sq W|  j j | ƒ 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(    (    sE   /home/wilkie/singularity/occam/occam/init/python/lib/python2.7/abc.pyR4   “   s6    N(
   R   R   R   R   R   R*   R   R1   R7   R4   (    (    (    sE   /home/wilkie/singularity/occam/occam/init/python/lib/python2.7/abc.pyR	   @   s   				(    (	   R   R$   R    R#   R3   R   t   propertyR   R	   (    (    (    sE   /home/wilkie/singularity/occam/occam/init/python/lib/python2.7/abc.pyt   <module>   s   	