o
    'èhV  ã                   @  sB   d Z ddlmZ ddlmZmZ dd	d
„Zddd„Zddd„ZdS )zrSetstate and getstate functions for objects with __slots__, allowing
compatibility with default pickling protocol
é    )Úannotations)ÚAnyÚMappingÚselfr   ÚstateÚreturnÚNonec                 C  s"   |  ¡ D ]
\}}t| ||ƒ qd S ©N)ÚitemsÚsetattr)r   r   ÚslotÚvalue© r   úI/var/www/html/olx_land/venv/lib/python3.10/site-packages/bson/_helpers.pyÚ_setstate_slots   s   ÿr   ÚnameÚstrÚprefixc                 C  s&   |   d¡rd| }||  S d}||  S )NÚ__Ú_Ú )Ú
startswith)r   r   r   r   r   Ú_mangle_name   s
   
ÿr   úMapping[Any, Any]c                 C  s>   | j j}i }| jD ]}t||ƒ}t| |ƒrt| |ƒ||< q	|S r	   )Ú	__class__Ú__name__Ú	__slots__r   ÚhasattrÚgetattr)r   r   Úretr   Úmangled_namer   r   r   Ú_getstate_slots$   s   


€r!   N)r   r   r   r   r   r   )r   r   r   r   r   r   )r   r   r   r   )	Ú__doc__Ú
__future__r   Útypingr   r   r   r   r!   r   r   r   r   Ú<module>   s   

