← Back
Editing: __init__.cpython-311.pyc
� �j�b�+ � � � d dl mZ d dlZd dlZd dlmZ ddl m Z ddlmZ ej rddlmZ dd lmZ G d � dej � � Z G d� d ej � � Zdd�d%d�Zdd�d&d�Zdd�d'd�Zdd�d(d�Zd)d �Zd*d!�Zd+d$�ZdS ),� )�annotationsN)�htmlsafe_json_dumps� )�current_app� ��_default)�Flask)�Responsec �, � � e Zd ZdZd� fd�Zd d�Z� xZS ) �JSONEncodera> The default JSON encoder. Handles extra types compared to the built-in :class:`json.JSONEncoder`. - :class:`datetime.datetime` and :class:`datetime.date` are serialized to :rfc:`822` strings. This is the same as the HTTP date format. - :class:`decimal.Decimal` is serialized to a string. - :class:`uuid.UUID` is serialized to a string. - :class:`dataclasses.dataclass` is passed to :func:`dataclasses.asdict`. - :class:`~markupsafe.Markup` (or any object with a ``__html__`` method) will call the ``__html__`` method to get a string. Assign a subclass of this to :attr:`flask.Flask.json_encoder` or :attr:`flask.Blueprint.json_encoder` to override the default. .. deprecated:: 2.2 Will be removed in Flask 2.3. Use ``app.json`` instead. �return�Nonec �| �� dd l }|� dt d�� � t � � j di |�� d S )Nr z�'JSONEncoder' is deprecated and will be removed in Flask 2.3. Use 'Flask.json' to provide an alternate JSON implementation instead.� �� stacklevel� ��warnings�warn�DeprecationWarning�super�__init__��self�kwargsr � __class__s ��5/usr/lib/python3/dist-packages/flask/json/__init__.pyr zJSONEncoder.__init__% �Y �� ������ � � ,� �� � � � � �����"�"�6�"�"�"�"�"� �o�t.Anyc � � t |� � S )z�Convert ``o`` to a JSON serializable type. See :meth:`json.JSONEncoder.default`. Python does not support overriding how basic types like ``str`` or ``list`` are serialized, they are handled before this method. r )r r"