�
��Vc�_ c s0 � d Z ddlZddlZddlZddlZddlZ ddl
mZ g d�Z
ddddd �d
�Zddddd �d�Zdd�d
�Zd� Zd� Zd� Z G d� d� � Zd� Z G d� d� � Z eeeeeee ed� � h� � Zd� Z dd�Z!d� Z"e#dk r e!� � dS dS )a/ Support to pretty-print lists, tuples, & dictionaries recursively.
Very simple, but useful, especially in debugging data structures.
Classes
-------
PrettyPrinter()
Handle pretty-printing operations onto a stream using a configured
set of formatting parameters.
Functions
---------
pformat()
Format a Python object into a pretty-printed representation.
pprint()
Pretty-print a Python object to a stream [default is sys.stdout].
saferepr()
Generate a 'standard' repr()-like value, but protect against recursive
data structures.
� N)�StringIO)�pprint�pformat�
isreadable�isrecursive�saferepr�
PrettyPrinter�pp� �P FT��compact�
sort_dicts�underscore_numbersc s\ � t |||||||�� � }|� | � � dS )zAPretty-print a Python object to a stream [default is sys.stdout].)�stream�indent�width�depthr r
r N)r r ) �objectr r r r r r
r Zprinter� �/usr/lib64/python3.11/pprint.pyr r 0 sC � � ��f�E���J�-�/� /� /�G� �N�N�6������ c sR � t ||||||�� � � | � � S )z<Format a Python object into a pretty-printed representation.)r r r r r
r )r r )r r r r r r
r � r r r 9 s8 � � ��e�5�!(�Z�,>�@� @� @�@G�����Pr )r
c s* � t | g|�R d|i|�� dS )zPretty-print a Python objectr
N)r )r r
ZargsZkwargss r r r @ s+ � �
�6�:�D�:�:�:�Z�:�6�:�:�:�:�:r c sV � t � � � | i dd� � d S )z=Version of repr() which can handle recursive data structures.Nr �r �
_safe_repr�r � r r r D �% � ��?�?�%�%�f�b�$��:�:�1�=�=r c �V � t � � � | i dd� � d S )z4Determine if saferepr(object) is readable by eval().Nr r r r r r r r H r r c r )z8Determine if object requires a recursive representation.Nr � r r r r r r L r r c s$ � e Zd ZdZdgZd� Zd� ZdS )� _safe_keyaU Helper function for key functions when sorting unorderable objects.
The wrapped-object will fallback to a Py2.x style comparison for
unorderable types (sorting first comparing the type name and then by
the obj ids). Does not work recursively, so dict.items() must have
_safe_key applied to both the key and the value.
�objc s � || _ d S �N)r )�selfr � r �__init__z_safe_key.__init__\ s
� �����r c s � | j |j k S # t $ ro t t | j � � � � t | j � � ft t |j � � � � t |j � � fk cY S w xY wr! )r Z TypeError�str�type�id)r"