File: //opt/alt/python37/lib/python3.7/site-packages/jsons/__pycache__/_fork_impl.cpython-37.pyc
B
�P�e� � @ sP d Z ddlmZmZ ddlmZmZmZ edfee ee ee d�dd�Z dS )zk
PRIVATE MODULE: do not import (from) it directly.
This module contains the implementation of ``fork()``.
� )�Type�Optional)�StateHolder�get_class_name�TN)� fork_inst�name�returnc C s� | j d7 _ |r|}nd�t| �| j �}t|| fi �}| j�� |_| j�� |_| j�� |_| j�� |_d|_ | j |_ | j
�� |_
|S )ah
Fork from the given ``StateHolder`` to create a separate "branch" of
serializers and deserializers.
:param fork_inst: The ``StateHolder`` on which the new fork is based.
:param name: The ``__name__`` of the new ``type``.
:return: A "fork inst" that can be used to separately store
(de)serializers from the regular ``StateHolder``.
� z {}_fork{}r )Z
_fork_counter�formatr �typeZ_classes_serializers�copyZ_classes_deserializersZ_serializersZ_deserializersZ_suppress_warningsZ_suppressed_warnings)r r �
class_name�result� r �A/opt/alt/python37/lib/python3.7/site-packages/jsons/_fork_impl.py�fork s r )
�__doc__�typingr r Zjsons._common_implr r r �strr r r r r �<module> s