관리-도구
편집 파일: _inspect.cpython-311.pyc
� �܋f � � � d Z ddlZddgZd� Zd� Zd� Zd\ ZZZZ d � Z d � Zd� Zd� Z e fd �Zddded� d� d� e fd�Zed� d� d� e fd�ZdS )z�Subset of inspect module from upstream python We use this instead of upstream because upstream inspect is slow to import, and significantly contributes to numpy import times. Importing this copy has almost no overhead. � N� getargspec� formatargspecc �6 � t | t j � � S )a� Return true if the object is an instance method. Instance method objects provide these attributes: __doc__ documentation string __name__ name with which this method was defined im_class class object in which this method belongs im_func function object containing implementation of method im_self instance to which this method is bound, or None )� isinstance�types� MethodType��objects �L/opt/cloudlinux/venv/lib64/python3.11/site-packages/numpy/_utils/_inspect.py�ismethodr s � � �f�e�.�/�/�/� c �6 � t | t j � � S )a Return true if the object is a user-defined function. Function objects provide these attributes: __doc__ documentation string __name__ name with which this function was defined func_code code object containing compiled function bytecode func_defaults tuple of any default values for arguments func_doc (same as __doc__) func_globals global namespace in which this function was defined func_name (same as __name__) )r r �FunctionTyper s r � isfunctionr s � � �f�e�0�1�1�1r c �6 � t | t j � � S )a� Return true if the object is a code object. Code objects provide these attributes: co_argcount number of arguments (not including * or ** args) co_code string of raw compiled bytecode co_consts tuple of constants used in the bytecode co_filename name of file in which this code object was created co_firstlineno number of first line in Python source code co_flags bitmap: 1=optimized | 2=newlocals | 4=*arg | 8=**arg co_lnotab encoded mapping of line numbers to bytecode indices co_name name with which this code object was defined co_names tuple of names of local variables co_nlocals number of local variables co_stacksize virtual machine stack space required co_varnames tuple of names of arguments and local variables )r r �CodeTyper s r �iscoder ) s � �$ �f�e�n�-�-�-r )� � � � c �z � t | � � st d� � �| j }| j }t |d|� � � }t |� � D ]#}|| dd� dv rt d� � ��$d}| j t z r| j | }|dz }d}| j t z r | j | }|||fS )a Get information about the arguments accepted by a code object. Three things are returned: (args, varargs, varkw), where 'args' is a list of argument names (possibly containing nested lists), and 'varargs' and 'varkw' are the names of the * and ** arguments or None. zarg is not a code objectNr )� �.z*tuple function arguments are not supported) r � TypeError�co_argcount�co_varnames�list�range�co_flags� CO_VARARGS�CO_VARKEYWORDS)�co�nargs�names�args�i�varargs�varkws r �getargsr* A s� � � �"�:�:� 4��2�3�3�3��N�E��N�E���f�u�f� ���D� �5�\�\� J� J����7�2�A�2�;�)�#�#��H�I�I�I� $��G� �{�Z�� ��.��'���� ���E� �{�^�#� &���u�%����%��r c � � t | � � r| j } t | � � st d� � �t | j � � \ }}}|||| j fS )am Get the names and default values of a function's arguments. A tuple of four things is returned: (args, varargs, varkw, defaults). 'args' is a list of the argument names (it may contain nested lists). 'varargs' and 'varkw' are the names of the * and ** arguments or None. 'defaults' is an n-tuple of the default values of the last n arguments. zarg is not a Python function)r �__func__r r r* �__code__�__defaults__)�funcr&