U
    DvfJ  ã                   @   sB   d ddgZ z
ejZW n ek
r0   dd„ ZY nX eZdd„ ZdS )ÚpopCountÚ	bit_countÚbit_indicesc                 C   s   t | ƒ d¡S )NÚ1)ÚbinÚcount©Úv© r	   ú;/tmp/pip-unpacked-wheel-qlge9rch/fontTools/misc/intTools.pyr      s    c                 C   s    dd„ t t| ƒddd… ƒD ƒS )z†Return list of indices where bits are set, 0 being the index of the least significant bit.

    >>> bit_indices(0b101)
    [0, 2]
    c                 S   s   g | ]\}}|d kr|‘qS )r   r	   )Ú.0ÚiÚbr	   r	   r
   Ú
<listcomp>   s      zbit_indices.<locals>.<listcomp>Néÿÿÿÿ)Ú	enumerater   r   r	   r	   r
   r      s    N)Ú__all__Úintr   ÚAttributeErrorr   r   r	   r	   r	   r
   Ú<module>   s   

