File: //opt/alt/python312/lib64/python3.12/email/__pycache__/_policybase.cpython-312.opt-1.pyc
�
�铨�
g � � � d Z ddlZddlmZ ddlmZ ddlmZ g d�Z G d� d� Z d � Z
d
� Z G d� de ej �
� Z
e G d� de
� � Z e� Zy)zwPolicy framework for the email package.
Allows fine grained feature control of how the package parses and emits data.
� N)�header)�charset)�_has_surrogates)�Policy�Compat32�compat32c �: � � e Zd ZdZ� fd�Zd� Zd� Zd� Zd� Z� xZ S )�_PolicyBasea� Policy Object basic framework.
This class is useless unless subclassed. A subclass should define
class attributes with defaults for any values that are to be
managed by the Policy object. The constructor will then allow
non-default values to be set for these attributes at instance
creation time. The instance will be callable, taking these same
attributes keyword arguments, and returning a new instance
identical to the called instance except for those values changed
by the keyword arguments. Instances may be added, yielding new
instances with any non-default values from the right hand
operand overriding those in the left hand operand. That is,
A + B == A(<non-default values of B>)
The repr of an instance can be used to reconstruct the object
if and only if the repr of the values can be used to reconstruct
those values.
c �� �� |j � D ]T \ }}t | |� rt t | � ||� �'t dj
|| j j � � � y)z�Create new Policy, possibly overriding some defaults.
See class docstring for a list of overridable attributes.
�*{!r} is an invalid keyword argument for {}N) �items�hasattr�superr
�__setattr__� TypeError�format� __class__�__name__)�self�kw�name�valuer s ��8/opt/alt/python312/lib64/python3.12/email/_policybase.py�__init__z_PolicyBase.__init__) s^ �� � �8�8�:�K�D�%��t�T�"��k�$�3�D�%�@��@�G�G��d�n�n�5�5�7�8� 8� &� c �� � | j j � D ��cg c] \ }}dj ||� �� }}}dj | j j dj |� � S c c}}w )Nz{}={!r}z{}({})z, )�__dict__r
r r r �join)r r r �argss r �__repr__z_PolicyBase.__repr__7 sh � �$(�M�M�$7�$7�$9�<�$9�[�T�5� �!�!�$��.�$9�
� <����t�~�~�6�6�� � �$��H�H��<s �A2c � � | j j | j � }| j j � D ] \ }}t j |||� � |j � D ]W \ }}t
| |� s/t dj || j j � � �t j |||� �Y |S )z�Return a new instance with specified attributes changed.
The new instance has the same attribute values as the current object,
except for the changes passed in as keyword arguments.
r )
r �__new__r r
�objectr r r r r )r r � newpolicy�attrr s r �clonez_PolicyBase.clone<