| Server IP : 127.0.0.1 / Your IP : 216.73.216.109 Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10 System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64 User : SERVERWEB ( 0) PHP Version : 8.1.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/cygwin64/lib/python3.9/site-packages/sphinx/util/__pycache__/ |
Upload File : |
a
�abXT � @ sd d Z ddlZddlZddlmZ ddlmZ ddlmZmZm Z m
Z
mZmZm
Z
mZmZmZ ddlmZ ddlmZ ddlmZmZ ejd kr�dd
lmZ nddlmZ G dd
� d
�ZzddlmZ W n ey� dZY n0 edediZeejejf Z e!d�Z"ee#ge$f Z%ee#e#e#e&ee e#ef ee# ge
eej' eej( f f Z)e e#ee#gef f Z*eej'ge#f Z+e
e#e#e#e#f Z,e e#e e#e,f f Z-d(ee e e e#ef d�dd�Z.ee$d�dd�Z/d)ee e#e#d�dd�Z0d*ee e#e#d�dd�Z1d+ee e#e#d�dd�Z2d,ee#e#d�d d!�Z3d-ee#e#d�d"d#�Z4d.ee#e#d�d$d%�Z5ed&d'ee#gef ie� dS )/z�
sphinx.util.typing
~~~~~~~~~~~~~~~~~~
The composite types for Sphinx.
:copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
� N)�Struct)�
TracebackType)
�Any�Callable�Dict� Generator�List�Optional�Tuple�Type�TypeVar�Union)�nodes)�Inliner)�RemovedInSphinx60Warning�deprecated_alias�� � )�
ForwardRef)�_ForwardRefc @ s6 e Zd ZdZd
eedd�dd�Zeeed�dd �ZdS )r z#A pseudo ForwardRef class for py36.TN)�arg�is_argument�returnc C s
|| _ d S �N)r )�selfr r � r �6/usr/lib/python3.9/site-packages/sphinx/util/typing.py�__init__ s zForwardRef.__init__)�globalns�localnsr c C s t | j�}|�||�S r )r r �
_eval_type)r r r �refr r r � _evaluate s
zForwardRef._evaluate)T) �__name__�
__module__�__qualname__�__doc__r �boolr r r# r r r r r s r )� UnionTypez
struct.Structztypes.TracebackType)�objr r r c C s� ddl m} zt�| ||�W S ty: || di � Y S tyV || di � Y S tyr || di � Y S ty� i Y S 0 dS )z�Return a dictionary containing type hints for a function, method, module or class object.
This is a simple wrapper of `typing.get_type_hints()` that does not raise an error on
runtime.
r )�safe_getattr�__annotations__N)Zsphinx.util.inspectr+ �typing�get_type_hints� NameError�AttributeError� TypeError�KeyError)r* r r r+ r r r r. M s r. )�typr c C s t | dd�}|dkot| t�S )z&Check *typ* is system defined TypeVar.r% � r- )�getattr�
isinstancer )r3 �modnamer r r �is_system_TypeVarf s r8 �fully-qualified-except-typing)�cls�moder c s� ddl m} � dkrd}nd}�zh| du s2| tu r8W dS | tu rFW dS t| t�rV| W S | tv rpd |t| f W S |�| �r�tj d
kr�d|| j
| jf W S d| j W S n�t�rt| t��rt
| j�d
k� r�d| jv � r�d�� fdd�| jD ��}d| W S d�� fdd�| jD ��W S np| j
dv �rbt| d��rTd| jd�� fdd�| jD ��f W S d| j W S n$tj dk�rzt| � �W S t| � �W S W n" ttf�y� |�| � Y S 0 dS )aw Convert python class to a reST reference.
:param mode: Specify a method how annotations will be stringified.
'fully-qualified-except-typing'
Show the module name and qualified name of the annotation except
the "typing" module.
'smart'
Show the name of the annotation.
r ��inspect�smart�~r4 Nz:py:obj:`None`�...�:py:class:`%s%s`�r �
�:py:class:`%s%s.%s`�:py:class:`%s`� � | c 3 s | ]}|rt |� �V qd S r ��restify��.0�a�r; r r � <genexpr>� � zrestify.<locals>.<genexpr>zOptional[%s]c 3 s | ]}t |� �V qd S r rH rJ rM r r rN � rO )Z__builtin__�builtins�__args__z:py:class:`%s`\ [%s]�, c 3 s | ]}t |� �V qd S r rH �rK r rM r r rN � rO r )�sphinx.utilr= �NoneType�Ellipsisr6 �str�INVALID_BUILTIN_CLASSES� isNewType�sys�version_infor% r$ r) �lenrQ �join�hasattr�
_restify_py37�
_restify_py36r0 r1 Zobject_description)r: r; r= � modprefix�argsr rM r rI l sD
�rI c s� ddl m} � dkrd}nd}|�| �r�| jdkr�| jtu r�t| j�dkr�| jd tu r�t| j�d kr�d
� � fdd�| jd
d� D ��}d| S dt
| jd � � S n"d
� � fdd�| jD ��}d| S �n|�| ��r6t| jtj
�r�t
| j� �}nLt| dd
��r4| jdk�r d| j| jf }nd|| j| jf }nt
| j� �}t| dd
�}t| d��sZn�tdd� | jD ���rrn�| jdk�r�| jdk�r�d
� � fdd�| jd
d� D ��}|d|t
| jd � �f 7 }nh| jdk�rt|dd
�dk�r|dd
� dd� | jD �� 7 }n*| j�r2|dd
� � fdd�| jD �� 7 }|S t| tj
��rTd| j| jf S t| d ��r�| jdk�r|d| j| jf S d|| j| jf S nDt| t��r�d!| j S | jdk�r�d| j| jf S d"|| j| jf S d
S )#z)Convert python class to a reST reference.r r<