o
    éT•j'  ã                   @   sF   d Z g d¢ZddlZefZG dd„ deƒZG dd„ deƒZ	dd	„ Z
dS )
z¡Python version compatibility support for minidom.

This module contains internal implementation details and
should not be imported; use xml.dom.minidom instead.
)ÚNodeListÚEmptyNodeListÚStringTypesÚdefpropertyé    Nc                   @   s>   e Zd ZdZdd„ Zdd„ Zdd„ Zeeedd	�Zd
d„ Z	dS )r   © c                 C   s(   d|  krt | ƒk r| | S  d S d S ©Nr   ©Úlen©ÚselfÚindexr   r   ú)/usr/lib/python3.10/xml/dom/minicompat.pyÚitem5   s   
ÿzNodeList.itemc                 C   s   t | ƒS ©Nr   ©r   r   r   r   Ú_get_length9   s   zNodeList._get_lengthc                 C   ó   t j d¡‚©Nz.attempt to modify read-only attribute 'length'©ÚxmlÚdomÚNoModificationAllowedErr©r   Úvaluer   r   r   Ú_set_length<   ó   ÿzNodeList._set_lengthú$The number of nodes in the NodeList.©Údocc                 C   s   |d u rg }|| d d …< d S r   r   )r   Ústater   r   r   Ú__setstate__D   s   zNodeList.__setstate__N)
Ú__name__Ú
__module__Ú__qualname__Ú	__slots__r   r   r   ÚpropertyÚlengthr    r   r   r   r   r   2   s    ÿr   c                   @   sF   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	„ Zd
d„ Ze	eedd�Z
dS )r   r   c                 C   ó   t ƒ }| |¡ |S r   ©r   Úextend©r   ÚotherÚNLr   r   r   Ú__add__M   ó   
zEmptyNodeList.__add__c                 C   r'   r   r(   r*   r   r   r   Ú__radd__R   r.   zEmptyNodeList.__radd__c                 C   s   d S r   r   r
   r   r   r   r   W   ó   zEmptyNodeList.itemc                 C   s   dS r   r   r   r   r   r   r   Z   r0   zEmptyNodeList._get_lengthc                 C   r   r   r   r   r   r   r   r   ]   r   zEmptyNodeList._set_lengthr   r   N)r!   r"   r#   r$   r-   r/   r   r   r   r%   r&   r   r   r   r   r   J   s    
ÿr   c                 C   sR   t | d| ƒ}|fdd„}t| d| ƒrJ d| ƒ‚t|||d�}t| ||ƒ d S )NÚ_get_c                 S   s   t j dt|ƒ ¡‚)Nz&attempt to modify read-only attribute )r   r   r   Úrepr)r   r   Únamer   r   r   Úsetg   s   
ÿzdefproperty.<locals>.setÚ_set_zexpected not to find _set_r   )ÚgetattrÚhasattrr%   Úsetattr)Úklassr3   r   Úgetr4   Úpropr   r   r   r   e   s   ÿr   )Ú__doc__Ú__all__Úxml.domr   Ústrr   Úlistr   Útupler   r   r   r   r   r   Ú<module>   s    *