3
®?d]t  ã               @   sr   d d„ Z dZdZeefdd„Zeefdd	„Zyd
dlmZmZmZ dZ	W n$ e
k
rl   e ZeZeZd
Z	Y nX dS )c                s&   ‡ ‡‡fdd„}ˆ|_ ˆ |_ˆ|_|S )Nc                 s    ˆj ƒ }|j|ƒ ˆˆ |  |ŽS )N)ÚcopyÚupdate)ZfargsZ	fkeywordsZnewkeywords)ÚargsÚfuncÚkeywords© ú1/tmp/pip-build-op5p2y5_/shapely/shapely/ftools.pyÚnewfunc   s    
z_partial.<locals>.newfunc)r   r   r   )r   r   r   r   r   )r   r   r   r   Ú_partial   s
    r	   Ú
__module__Ú__name__Ú__doc__Ú__dict__c             C   sJ   x|D ]}t | |t||ƒƒ qW x$|D ]}t| |ƒjt||i ƒƒ q&W | S )a  Update a wrapper function to look like the wrapped function

       wrapper is the function to be updated
       wrapped is the original function
       assigned is a tuple naming the attributes assigned directly
       from the wrapped function to the wrapper function (defaults to
       functools.WRAPPER_ASSIGNMENTS)
       updated is a tuple naming the attributes of the wrapper that
       are updated with the corresponding attribute from the wrapped
       function (defaults to functools.WRAPPER_UPDATES)
    )ÚsetattrÚgetattrr   )ÚwrapperÚwrappedÚassignedÚupdatedÚattrr   r   r   Ú_update_wrapper!   s
    

r   c             C   s   t t| ||d�S )a‹  Decorator factory to apply update_wrapper() to a wrapper function

       Returns a decorator that invokes update_wrapper() with the decorated
       function as the wrapper argument and the arguments to wraps() as the
       remaining arguments. Default arguments are as for update_wrapper().
       This is a convenience function to simplify applying partial() to
       update_wrapper().
    )r   r   r   )r	   r   )r   r   r   r   r   r   Ú_wraps7   s    r   é    )ÚpartialÚupdate_wrapperÚwrapsé   N)r
   r   r   )r   )r	   ÚWRAPPER_ASSIGNMENTSÚWRAPPER_UPDATESr   r   Ú	functoolsr   r   r   Zhave_functoolsÚImportErrorr   r   r   r   Ú<module>   s   