관리-도구
편집 파일: decorator.cpython-36.opt-1.pyc
3 5*[Z�@ � @ s� d Z ddlmZ ddlZddlZddlZddlZddlZddlZdZ ej dkrdddlmZ dd� Znej d d �Zdd� Zd d� Zy ejZW n ek r� dd� ZY nX ej dd�Zdd� Zejd�ZG dd� de�Zf fdd�Zd*dd�ZyddlmZ W n" ek �r ddlmZ Y nX G dd� de�Zeej�Ze ej!�Z"e"dk�rhej# �rhd d!� Zee_n,e"dk�r|ej#�r|ne"d"k�r�d#d!� Zee_ee�Z$d$d%� Z%d&d'� Z&d(d)� Z'dS )+zT Decorator module, see http://pypi.python.org/pypi/decorator for the documentation. � )�print_functionNz4.2.1�3)�getfullargspecc C s | j S )N)�__init__)�cls� r �/usr/lib/python3.6/decorator.py�get_init0 s r �FullArgSpecz5args varargs varkw defaults kwonlyargs kwonlydefaultsc C s t jtj| �g df �S )z?A quick and dirty replacement for getfullargspec for Python 2.XN)r �_make�inspect� getargspec)�fr r r r 7 s r c C s | j jS )N)r �__func__)r r r r r ; s c C s dS )NFr )r r r r �iscoroutinefunctionB s r �ArgSpeczargs varargs varkw defaultsc C s t | �}t|j|j|j|j�S )z$A replacement for inspect.getargspec)r r �args�varargs�varkw�defaults)r �specr r r r J s r z\s*def\s*([_\w][_\w\d]*)\s*\(c @ sZ e Zd ZdZej� Zf Z Z Z Z ZZd dd�Z dd� Zddd �Zeddd��ZdS )� FunctionMakerz� An object with the ability to create functions with a given signature. It has attributes name, doc, module, signature, defaults, dict and methods update and make. Nc C s� || _ |�rf|j| _| jdkr$d| _|j| _|j| _tj|��rft |�}t |di �| _xdD ]} t| | t || �� q\W x&t | j�D ]\} }t| d | |� q�W t| j�}t| j�} | jr�|jd| j � | jd| j � n| jr�|jd� x.| jD ]$} |jd| � | jd | | f � q�W | j�rB|jd| j � | jd| j � dj|�| _dj| �| _ |jj� | _|�rr|| _|d k �r�|| _|�r�|| _|�r�|| _|�r�|| _|�r�|| _t| d��s�td| ��d S )Nz<lambda>�_lambda_�__annotations__r r r r � kwonlyargs�kwonlydefaultszarg%d�*z%s=Nonez%s=%sz**z, � signaturez%You are decorating a non function: %s)r r r r r r )�shortsignature�__name__�name�__doc__�doc� __module__�moduler � isfunctionr �getattr�annotations�setattr� enumerater �listr �appendr r �joinr �__dict__�copy�dictr �hasattr� TypeError)�self�funcr r r r"