U
    luf­  ã                   @   s$   d Z ddlmZ eedœdd„ZdS )zUUtils for interoperability with other libraries.

Just CFFI pointer casting for now.
é    )ÚAny)ÚnÚreturnc                 C   sd   t | tƒr| S zddl}W n tk
r.   Y n&X | ¡ }t | |jƒrTt| d| ¡ƒS td|  ƒ‚dS )zZCast an address to a Python int

    This could be a Python integer or a CFFI pointer
    r   NZsize_tzCannot cast %r to int)Ú
isinstanceÚintÚcffiÚImportErrorZFFIZCDataÚcastÚ
ValueError)r   r   Úffi© r   ú5/tmp/pip-unpacked-wheel-h6ekxre8/zmq/utils/interop.pyÚcast_int_addr   s    
r   N)Ú__doc__Útypingr   r   r   r   r   r   r   Ú<module>   s   