File: //kunden/lib/python3/dist-packages/breezy/__pycache__/static_tuple.cpython-39.pyc
a
�*�^� �
@ s� d Z ddlmZ ddlmZ zddlmZ W nF eyr Z z.ddlm Z e �
e� ddlmZ W Y dZ[n
dZ[0 0 dd � Zd
d� Z
dS )z1Interface thunk for a StaticTuple implementation.� )�absolute_import� )�debug)�StaticTuple)�osutilsNc C s4 dt jvrt�| �S t| t�s0tdt| �f ��| S )a Check if the passed object is a StaticTuple.
Cast it if necessary, but if the 'static_tuple' debug flag is set, raise an
error instead.
As apis are improved, we will probably eventually stop calling this as it
adds overhead we shouldn't need.
Zstatic_tuplez"We expected a StaticTuple not a %s)r Zdebug_flagsr Z
from_sequence�
isinstance� TypeError�type)�obj� r �5/usr/lib/python3/dist-packages/breezy/static_tuple.py�expect_static_tuple s
r
c C s8 g }| D ]&}t |tttf�r$t|�}|�|� qt|�S )z�Ensure that the object and any referenced objects are plain tuples.
:param obj: a list, tuple or StaticTuple
:return: a plain tuple instance, with all children also being tuples.
)r �tuple�listr � as_tuples�append)r
�result�itemr r r r / s r )�__doc__Z
__future__r � r Z_static_tuple_cr �ImportError�er Zfailed_to_load_extensionZ_static_tuple_pyr
r r r r r �<module> s
"