U
    ڲg                     @  s  U d Z ddlmZ ddlZddlmZmZmZ ddlm	Z
 ddlmZ ddlmZ eegef Zd	ed
< eegdf Zd	ed< eegef Zd	ed< eegdf Zd	ed< G dd deZeeedjZeeedjZeeedjZeeedjZeeedjZeeedjZeeedjZ eeedj!Z"eeedj!Z#eeedj!Z$eeedj!Z%eeedj!Z&eeedj!Z'eeedj!Z(edZ)eeegef e)jZ*eee)j+Z,dddddZ-edde.dkre-ZdS ) z0
Utility functions to deal with binary structs.
    )annotationsN)CallablecastProtocol   )errors)Buffer)	TypeAliasr	   PackInt
tuple[int]	UnpackInt	PackFloatztuple[float]UnpackFloatc                   @  s   e Zd ZddddddZdS )	UnpackLenr   z
int | Noner   )datastartreturnc                 C  s   d S )N )selfr   r   r   r   3/tmp/pip-unpacked-wheel-b_ea6rx_/psycopg/_struct.py__call__       zUnpackLen.__call__N)__name__
__module____qualname__r   r   r   r   r   r      s   r   z!hz!Hz!iz!Iz!qz!fz!dfloatbytes)xr   c                 C  s   t dd S )Nzcannot dump Float4: Python affected by bug #304. Note that the psycopg-c and psycopg-binary packages are not affected by this issue. See https://github.com/psycopg/psycopg/issues/304)eZInterfaceError)r   r   r   r   pack_float4_bug_304/   s    r   g      ?Z3f800000)/__doc__
__future__r   structtypingr   r   r    r   r   abcr   _compatr	   intr   r
   __annotations__r   r   r   r   r   StructpackZ	pack_int2Z
pack_uint2Z	pack_int4Z
pack_uint4Z	pack_int8Zpack_float4Zpack_float8unpackZunpack_int2Zunpack_uint2Zunpack_int4Zunpack_uint4Zunpack_int8Zunpack_float4Zunpack_float8Z_struct_lenZpack_lenunpack_fromZ
unpack_lenr   fromhexr   r   r   r   <module>   s>   
	