o
    <ºi³	  ã                   @   sP   d dl mZmZmZ d dlmZmZ edƒZedƒZG dd„ deeef ƒZ	dS )é    )ÚIteratorÚMappingÚSequence)ÚTypeVarÚcastÚKÚVc                   @   sŒ   e Zd ZdZdZdeeeeB   fdd„Zde	eef fdd„Z
d	edefd
d„Zdee fdd„Zdefdd„Zde	eef fdd„ZdS )ÚLazyDictz1Lazily build a dictionary from an array of items.©Ú	_contentsÚ_dictÚcontentsc                 C   s   || _ d | _d S )Nr
   )Úselfr   © r   úU/home/ubuntu/veenaModal/venv/lib/python3.10/site-packages/pyiceberg/utils/lazydict.pyÚ__init__'   s   
zLazyDict.__init__Úreturnc                 C   sZ   i | _ | jD ]#}| j  ttttt |d d d… ƒttt |dd d… ƒddƒ¡ q| j S )Né   é   T)Ústrict)	r   r   ÚupdateÚdictÚzipr   r   r   r   )r   Úitemr   r   r   Ú_build_dict+   s   
DzLazyDict._build_dictÚkeyc                C   s   | j p|  ¡ }|| S )z#Return the value for the given key.©r   r   )r   r   Úsourcer   r   r   Ú__getitem__2   ó   zLazyDict.__getitem__c                 C   ó   | j p|  ¡ }t|ƒS )z3Return an iterator over the keys of the dictionary.)r   r   Úiter©r   r   r   r   r   Ú__iter__7   r   zLazyDict.__iter__c                 C   r    )z-Return the number of items in the dictionary.)r   r   Úlenr"   r   r   r   Ú__len__<   r   zLazyDict.__len__c                 C   s   | j p|  ¡ S )z Convert the lazy dict in a dict.r   )r   r   r   r   Ú__dict__A   s   zLazyDict.__dict__N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r   r   r   r   r   r   r   r   r#   Úintr%   r&   r   r   r   r   r	      s    r	   N)
Úcollections.abcr   r   r   Útypingr   r   r   r   r	   r   r   r   r   Ú<module>   s
   