← Back
Editing: decorator.cpython-311.pyc
� d�c�: � �� � d Z ddlZddlZddlZddlZddlZddlZddlmZ dZd� Z ej dd� � Zd� Z ej d � � Z G d � d� � Zd� Zdd �Z ddlmZ n# e$ r ddlmZ Y nw xY w G d� de� � Z eej � � Z eej � � Zedk rej sd� Zee_ nedk rej rnedk r d� Zee_ ee� � Zd� Zd� ZdS )zU Decorator module, see https://pypi.python.org/pypi/decorator for the documentation. � N)�getfullargspecz4.0.5c � � | j S �N)�__init__)�clss �6/usr/lib/python3/dist-packages/scipy/_lib/decorator.py�get_initr . s � ��<�� �ArgSpeczargs varargs varkw defaultsc �l � t | � � }t |j |j |j |j � � S )z$A replacement for inspect.getargspec)r r �args�varargs�varkw�defaults)�f�specs r � getargspecr 7 s+ � ��!���D��4�9�d�l�D�J�� �F�F�Fr z\s*def\s*([_\w][_\w\d]*)\s*\(c �f � e Zd ZdZ ej � � Z d d�Zd� Zd d�Z e dd�� � 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 � � || _ |�r|j | _ | j dk rd| _ |j | _ |j | _ t j |� � �r�t |� � }t |di � � | _ dD ]!} t | | t || � � � � �"t | j � � D ]\ } }t | d| z |� � �t | j � � }t | j � � } | j r;|� d| j z � � | � d| j z � � n| j r|� d� � | j D ]4} |� d| z � � | � | �d| ��� � �5| j r:|� d | j z � � | � d | j z � � d � |� � | _ d � | � � | _ |j � � � | _ |r|| _ |�|| _ |r|| _ |r|| _ |r|| _ |r|| _ t5 | d� � sJ �t5 | d� � st7 d |z � � �d S )N�<lambda>�_lambda_�__annotations__)r r r r � kwonlyargs�kwonlydefaultszarg%d�*z%s=None�=z**�, �name� signaturez%You are decorating a non-function: %s)�shortsignature�__name__r �__doc__�doc� __module__�module�inspect� isfunctionr �getattr�annotations�setattr� enumerater �listr �appendr r �joinr �__dict__�copy�dictr �hasattr� TypeError)�self�funcr r r r$ r&