
    Ef              	       n    d Z ddlZddlmZmZmZmZ eZdedefdZ	deee
f   deeee
eef   fdZd	d
gZy)a  JSON serialize to/from utf8 bytes

.. versionchanged:: 22.2
    Remove optional imports of different JSON implementations.
    Now that we require recent Python, unconditionally use the standard library.
    Custom JSON libraries can be used via custom serialization functions.
    N)AnyDictListUnionoreturnc                 L    t        j                  | fi |j                  d      S )znSerialize object to JSON bytes (utf-8).

    Keyword arguments are passed along to :py:func:`json.dumps`.
    utf8)jsondumpsencode)r   kwargss     3/usr/lib/python3/dist-packages/zmq/utils/jsonapi.pyr   r      s#    
 ::a"6"))&11    sc                 p    t        | t              r| j                  d      } t        j                  | fi |S )zkLoad object from JSON bytes (utf-8).

    Keyword arguments are passed along to :py:func:`json.loads`.
    r
   )
isinstancebytesdecoder   loads)r   r   s     r   r   r      s0    
 !UHHV::a"6""r   r   r   )__doc__r   typingr   r   r   r   jsonmodr   r   strintfloatr   __all__ r   r   <module>r      sg     ) ) 2S 2u 2#U5#: #U4sC3N-O # G
r   