Current File : //proc/self/root/usr/lib/python3/dist-packages/hyperlink/__pycache__/_url.cpython-312.pyc |
�
G�_cF � � � d Z ddlZddlZddlZddlZddlmZmZ ddlmZ ddl
mZmZm
Z
mZmZmZmZmZmZmZmZmZmZmZmZ ddlmZ ddlmZ dd lmZ dd
l!m"Z#m$Z% ejL d dk( Z' e( e+d� Z,eeeee f df Z-eeeee f e-eeeee f f Z. ed
� Z/d�d�Z0 e0d� xZ1Z2 e3d� Z4 ejj d� Z6 ejj d� Z7 ejj d� Z8 e9ejt D � �cg c]H } ejt D ]7 }| |z jE d� e( e | |z d� � jE d� f��9 �J c}} � Z; ejj d� Z< e3d� Z= e3d� Z>e=e>z Z?e4e>z e@d� z ZAe?eAz
ZBeA e@d� z ZCe?eCz
ZDeC e@d� z
ZEe?eEz
ZFe4eCz e@d� z ZGe?eGz
ZHe4eG e@d� z
z ZIe?eIz
ZJe4eI e@d� z
z ZKe?eKz
ZLd�d!�ZMd"� ZN eNeA� ZO eMeB� ZP eNeC� ZQ eNeE� ZR eMeD� ZS eNeK� ZT eMeL� ZU eNeI� ZV eMeJ� ZW eNeG� ZX eMeH� ZY eNe4� ZZ e9e;j� � D ��cg c] \ }}|jI dd#� e4v r||f�� c}}� Z\ e3d$� Z]d�d%�Z^d�d&�Z_d�d'�Z` d�d(�Zad�d)�Zbd�d*�Zcd�d+�Zdd�d,�Zei d-d.�d/d0�d1d2�d3d4�d5d�d6d7�d8d9�d:d;�d<d=�d>d?�d@dA�dBdC�dDdC�dEdF�dGdH�dIdJ�dKdL�i dMdN�dOdP�dQd�dRdS�dTdU�dVdW�dXdY�dZd[�d\d]�d^d_�d`da�dbdc�ddde�dfdg�dhdi�djdk�dldm��diddndodpdqdrd=d?dds�
�Zf e@g dt�� Zg e@� Zh d�du�Zid�dv�Zj G dw� dxek� Zldy� Zmdz� Zn e3� d fd{�Zod|� Zpd�d}�Zq d�d~�Zrd�d�Zsd�d��Zt d�d��Zu d�d��Zvd d�d d e;fd��Zwd�� Zxd�� Zyd�� Zz G d�� d�e{� Z|e|Z} e|� Z~d�� Zd�� Z� G d�� d�e{� Z�d�d��Z�y# e$ r e ZY ���w xY w# e$ r
dd l mZ Y ���w xY w# e)$ r e*Z(Y ���w xY wc c}} w c c}}w )�a Hyperlink provides Pythonic URL parsing, construction, and rendering.
Usage is straightforward::
>>> import hyperlink
>>> url = hyperlink.parse(u'http://github.com/mahmoud/hyperlink?utm_source=docs')
>>> url.host
u'github.com'
>>> secure_url = url.replace(scheme=u'https')
>>> secure_url.get('utm_source')[0]
u'docs'
Hyperlink's API centers on the :class:`DecodedURL` type, which wraps
the lower-level :class:`URL`, both of which can be returned by the
:func:`parse()` convenience function.
� N)�AF_INET�AF_INET6)�
AddressFamily)�Any�Callable�Dict�Iterable�Iterator�List�Mapping�Optional�Sequence�Text�Tuple�Type�TypeVar�Union�cast)� normalize� )� inet_pton)r )�encode�decode� .�Tc �8 � �� G � �fd�dt � } |� S )a� Creates and returns a new **instance** of a new class, suitable for
usage as a "sentinel", a kind of singleton often used to indicate
a value is missing when ``None`` is a valid input.
Args:
name: Name of the Sentinel
var_name: Set this name to the name of the variable in its respective
module enable pickle-ability.
>>> make_sentinel(var_name='_MISSING')
_MISSING
The most common use cases here in boltons are as default values
for optional function arguments, partly because of its
less-confusing appearance in automatically generated
documentation. Sentinels also function well as placeholders in queues
and linked lists.
.. note::
By design, additional calls to ``make_sentinel`` with the same
values will not produce equivalent objects.
>>> make_sentinel('TEST') == make_sentinel('TEST')
False
>>> type(make_sentinel('TEST')) == type(make_sentinel('TEST'))
False
c �6 �� e Zd Z� �fd�Zd� ZW �rd� Zd� ZeZy)�make_sentinel.<locals>.Sentinelc �"