HEX
Server: LiteSpeed
System: Linux us-phx-web1284.main-hosting.eu 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: u300739242 (300739242)
PHP: 8.2.30
Disabled: system, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/alt/python311/lib/python3.11/site-packages/jsons/__pycache__/_lizers_impl.cpython-311.pyc
�

)�;f��
��dZddlmZmZmZmZddlmZddlm	Z	m
Z
ddlmZde	fde
deeeefd	ed
eddf
d
�Zde	fde
deeeefd	ed
eddf
d�Zee	fded
eede
fd���Zee	fded
eede
fd���Z	ddedeee
fded
edede
fd�Zdedeee
fded
ede
f
d�Zdededefd�ZdS)z�
PRIVATE MODULE: do not import (from) it directly.

This module contains functionality for setting and getting serializers and
deserializers.
�)�Optional�Dict�Sequence�Union)�cached)�StateHolder�get_class_name)�get_naked_classT�func�cls�	high_prio�	fork_inst�returnNc�>�t|t��r|D]}t||||���dS|rb|rdnt|j��}|j�||��t
|d���}||j|���<dS||jd<dS)a�
    Set a serializer function for the given type. You may override the default
    behavior of ``jsons.load`` by setting a custom serializer.

    The ``func`` argument must take one argument (i.e. the object that is to be
    serialized) and also a ``kwargs`` parameter. For example:

    >>> def func(obj, **kwargs):
    ...    return dict()

    You may ask additional arguments between ``cls`` and ``kwargs``.

    :param func: the serializer function.
    :param cls: the type or sequence of types this serializer can handle.
    :param high_prio: determines the order in which is looked for the callable.
    :param fork_inst: if given, it uses this fork of ``JsonSerializable``.
    :return: None.
    rT��fully_qualified�nonetypeN)	�
isinstancer�set_serializer�len�_classes_serializers�insertr	�_serializers�lower�rrr
r�cls_�index�cls_names       �E/opt/alt/python311/lib/python3.11/site-packages/jsons/_lizers_impl.pyrrs���.�#�x� � �	2��	=�	=�D��4��y�)�<�<�<�<�	=�	=�	�2��G���C�	�(F�$G�$G���&�-�-�e�S�9�9�9�!�#�t�<�<�<��37�	��x�~�~�/�/�0�0�0�-1�	��z�*�*�*�c�>�t|t��r|D]}t||||���dS|rb|rdnt|j��}|j�||��t
|d���}||j|���<dS||jd<dS)a
    Set a deserializer function for the given type. You may override the
    default behavior of ``jsons.dump`` by setting a custom deserializer.

    The ``func`` argument must take two arguments (i.e. the dict containing the
    serialized values and the type that the values should be deserialized into)
    and also a ``kwargs`` parameter. For example:

    >>> def func(dict_, cls, **kwargs):
    ...    return cls()

    You may ask additional arguments between ``cls`` and ``kwargs``.

    :param func: the deserializer function.
    :param cls: the type or sequence of types this serializer can handle.
    :param high_prio: determines the order in which is looked for the callable.
    :param fork_inst: if given, it uses this fork of ``JsonSerializable``.
    :return: None.
    rTrrN)	rr�set_deserializerr�_classes_deserializersrr	�_deserializersrrs       rr"r"1s���0�#�x� � �	4��	?�	?�D��T�4��I�>�>�>�>�	?�	?�	�4��I���C�	�(H�$I�$I���(�/�/��s�;�;�;�!�#�t�<�<�<��59�	� ����!1�!1�2�2�2�/3�	� ��,�,�,r c�>�t||j|j|��}|S)a
    Return the serializer function that would be used for the given ``cls``.
    :param cls: the type for which a serializer is to be returned.
    :param fork_inst: if given, it uses this fork of ``JsonSerializable``.
    :return: a serializer function.
    )�
_get_lizerrr)rr�
serializers   r�get_serializerr(Us*���C��!7�%�:�I�G�G�J��r c�>�t||j|j|��}|S)a

    Return the deserializer function that would be used for the given ``cls``.
    :param cls: the type for which a deserializer is to be returned.
    :param fork_inst: if given, it uses this fork of ``JsonSerializable``.
    :return: a deserializer function.
    )r&r$r#)rr�deserializers   r�get_deserializerr+ds*���c�9�#;�'�>�	�K�K�L��r F�lizers�classes_lizers�	recursivec���t|tjd���}|�|d��pt	||||��}|s*|s(t|d��rt
|j|||d��S|S)NTr�
__supertype__)r	�strr�get�_get_lizer_by_parents�hasattrr&r0)rr,r-rr.r�lizers       rr&r&ss����c�3�9�d�C�C�C�H�
�Z�Z��$�
'�
'�N�%�c�6�>�9�M�M�
��;��;�w�s�O�'D�'D�;��#�+�V�(�)�T�;�;�	;��Lr c��d}t||��}|r*t|dtjd���}||}|S)NrTr)�_get_parentsr	r1r)rr,r-r�result�parents�pnames       rr3r3�sH��
�F��3��/�/�G����w�q�z�3�9�d�K�K�K�������Mr c��g}t|��}|D]?}	t||��r|�|���)#ttf$rY�<wxYw|S)z�
    Return a list of serializers or deserializers that can handle a parent
    of ``cls``.
    :param cls: the type that
    :param lizers: a list of serializers or deserializers.
    :return: a list of serializers or deserializers.
    )r
�
issubclass�append�	TypeError�AttributeError)rr,r9�	naked_clsrs     rr7r7�sy���G���$�$�I�����	��)�T�*�*�
%����t�$�$�$����>�*�	�	�	��D�	�����Ns�%=�A�A)F)�__doc__�typingrrrr�jsons._cacher�jsons._common_implrr	�jsons._compatibility_implr
�callable�type�boolrr"r(r+r1�listr&r3r7�r r�<module>rKs�����3�2�2�2�2�2�2�2�2�2�2�2�������:�:�:�:�:�:�:�:�5�5�5�5�5�5��%�	 2� 2�� 2�
�4��$��'�
(� 2�� 2��	 2�+/�	 2� 2� 2� 2�L�%�	!4�!4��!4�
�4��$��'�
(�!4��!4��	!4�+/�	!4�!4�!4�!4�H�%0���
���D�>��4<��������%0���
���D�>��4<�������& ���
���S�(�]�#�����	�
��
%-�����
�
�
��S�(�]�#�
��
��	
�%�	
�
�
�
��d��D��T������r