관리-도구
편집 파일: encoder.cpython-37.pyc
B VX�Y�j � @ sl d Z ddlmZ ddlZddlmZ ddlZddlmZm Z m Z mZmZm Z mZ dd� Ze� \ZZdd lmZ dd lmZ e�d�Ze�d�Ze�d �Zdddddddd�Zx&ed�D ]Ze�ee�def � q�W x"dD ]Ze�e e�def � q�W eZ eed�fdd�Z!efdd�Z"e�p"e"Z#G dd� de$�Z%G d d!� d!e%�Z&ee'ede(e)e*e e+e,e-e.e/f d"d#�Z0dS )$zImplementation of JSONEncoder � )�absolute_importN)� itemgetter� )�u�unichr�binary_type� text_type�string_types� integer_types�PY3c C s2 yddl m} | j| jfS tk r, dS X d S )Nr )� _speedups)NN)� r �encode_basestring_ascii�make_encoder�ImportError)r � r �E/opt/alt/python37/lib64/python3.7/site-packages/simplejson/encoder.py�_import_speedups s r )�PosInf)�RawJSONu [\x00-\x1f\\"\b\f\n\r\t ]z([\\"]|[^\ -~])z[\x80-\xff]z\\z\"z\bz\fz\nz\rz\t)�\�"��� � � � z\u%04x)i( i) r c C s� |r.t | t�r| �d�} t| �tk rdt| �} n6t | t�rPt�| �dk rP| �d�} t| �tkrdt| �} dd� }|t � || � | S )z5Return a JSON representation of a Python string zutf-8Nc S s t | �d� S )Nr )� ESCAPE_DCT�group)�matchr r r �replace9 s z"encode_basestring.<locals>.replace)� isinstancer �decode�typer �str�HAS_UTF8�searchr �ESCAPE�sub)�s�_PY3Z_qr! r r r �encode_basestring+ s r, c C s� |r.t | t�r| �d�} t| �tk rdt| �} n6t | t�rPt�| �dk rP| �d�} t| �tkrdt| �} dd� }dtt � || �� d S )zAReturn an ASCII-only JSON representation of a Python string zutf-8Nc S sv | � d�}yt| S tk rp t|�}|dk r<d|f S |d8 }d|d? d@ B }d|d@ B }d||f S Y nX d S ) Nr i z\u%04xi � � i� i � z\u%04x\u%04x)r r �KeyError�ord)r r* �n�s1�s2r r r r! L s z+py_encode_basestring_ascii.<locals>.replacer )r"