o
    ØÝ2g	  ã                   @  s:   d Z ddlmZ ddlZddlmZ G dd„ dejƒZdS )zžSplit namespace for argparse to allow separating options by prefix.

We use this to direct some options to an Options object and some to a
regular namespace.
é    )ÚannotationsN)ÚAnyc                   @  s4   e Zd Zddd	„Zddd„Zddd„Zddd„ZdS )ÚSplitNamespaceÚstandard_namespaceÚobjectÚalt_namespaceÚ
alt_prefixÚstrÚreturnÚNonec                 C  s"   || j d< || j d< || j d< d S )NÚ_standard_namespaceÚ_alt_namespaceÚ_alt_prefix)Ú__dict__)Úselfr   r   r   © r   úL/home/garg/my-data/venv/lib/python3.10/site-packages/mypy/split_namespace.pyÚ__init__   s   

zSplitNamespace.__init__útuple[Any, Any]c                 C  s   | j | jfS ©N)r   r   )r   r   r   r   Ú_get   s   zSplitNamespace._getÚnameÚvaluer   c                 C  s>   |  | j¡rt| j|t| jƒd … |ƒ d S t| j||ƒ d S r   )Ú
startswithr   Úsetattrr   Úlenr   )r   r   r   r   r   r   Ú__setattr__   s    zSplitNamespace.__setattr__c                 C  s2   |  | j¡rt| j|t| jƒd … ƒS t| j|ƒS r   )r   r   Úgetattrr   r   r   )r   r   r   r   r   Ú__getattr__   s   zSplitNamespace.__getattr__N)r   r   r   r   r   r	   r
   r   )r
   r   )r   r	   r   r   r
   r   )r   r	   r
   r   )Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   r   r   r      s
    


r   )Ú__doc__Ú
__future__r   ÚargparseÚtypingr   Ú	Namespacer   r   r   r   r   Ú<module>   s
    	