a
    i‚jÜ  ã                   @  s@   d Z ddlmZ ddlZejG dd„ dƒƒZdddœd	d
„ZdS )zAttributes parser.é    )ÚannotationsNc                   @  s   e Zd ZU dZded< dS )ÚExceptionWrapperz]Wrapper around an exception to signal an error was raised.

  While parsing the attribute.
  Ú	ExceptionÚeN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú__annotations__© r   r   úY/home/ghrups/robot-bench/.venv/lib/python3.9/site-packages/etils/ecolab/inspects/attrs.pyr      s   
r   Úobjectzdict[str, object])ÚobjÚreturnc                 C  sn   i }t | ƒt | ¡ D ]R}||v r$qzt| |ƒ}W n, ty^ } zt|ƒ}W Y d}~n
d}~0 0 |||< q|S )a  Parse all attributes from an object.

  Limitation:

  * Descriptor will be resolved, so all properties are executed (some can
    have side effects, or take a lot of time to compute)

  Args:
    obj: Object to inspect

  Returns:
    Dict mapping attribute name to values.
  N)Údirr   Ú__dir__Úgetattrr   r   )r   ÚattrsÚkÚvr   r   r   r   Ú	get_attrs   s    
r   )r	   Ú
__future__r   ÚdataclassesÚ	dataclassr   r   r   r   r   r   Ú<module>   s
   