관리-도구
편집 파일: _fields.cpython-311.pyc
� ���e. � �N � d Z ddlmZ ddlZddlZddlZddlmZ ddlm Z m Z ddlmZ ddl mZ dd lmZ dd lmZ ddlmZ ddlmZmZmZmZ e rd dlmZ d dlmZ ddlmZ ddlm Z d7d8d�Z! G d� de� � Z" G d� de"e� � Z#dd �d9d+�Z$d:d/�Z%dd �d;d2�Z&d<d5�Z'd<d6�Z(dS )=zmPrivate logic related to fields (the `Field()` function and `FieldInfo` class), and arguments to `Annotated`.� )�annotationsN)�copy)� TYPE_CHECKING�Any)�BaseMetadata)�PydanticUndefined� )� _typing_extra)� ConfigWrapper)�Representation)�get_cls_type_hints_lenient�get_type_hints�is_classvar�is_finalvar� �� FieldInfo�� BaseModel)�StandardDataclass)�DecoratorInfosF�objr �localns�dict[str, Any] | None�include_extras�bool�return�dict[str, Any]c � � t | dd� � }d}|r) t j | j }n# t $ r Y nw xY wt | |||�� � S )a� Gets type hints for an object by inferring the global namespace. It uses the `typing.get_type_hints`, The only thing that we do here is fetching global namespace from `obj.__module__` if it is not `None`. Args: obj: The object to get its type hints. localns: The local namespaces. include_extras: Whether to recursively include annotation metadata. Returns: The object type hints. � __module__N)�globalnsr r )�getattr�sys�modules�__dict__�KeyErrorr )r r r �module_namer! s �O/opt/cloudlinux/venv/lib/python3.11/site-packages/pydantic/_internal/_fields.py�get_type_hints_infer_globalnsr) sr � �$ �#�|�T�2�2�K�&*�H�� � ��{�;�/�8�H�H��� � � ��D� ���� �#��'�R`�a�a�a�as �/ � <�<c � � e Zd ZdZdZdS )�PydanticMetadataz0Base class for annotation markers like `Strict`.� N)�__name__r �__qualname__�__doc__� __slots__r, � r( r+ r+ 6 s � � � � � �:�:��I�I�Ir1 r+ c � � e Zd ZdZdd�ZdS )�PydanticGeneralMetadataz*Pydantic general metada like `max_digits`.�metadatar c � � || _ d S �N)r% )�selfr4 s r( �__init__z PydanticGeneralMetadata.__init__? s � � �� � � r1 N)r4 r )r- r r. r/ r8 r, r1 r( r3 r3 <