관리-도구
편집 파일: _fields.cpython-38.pyc
U /?�fV: � @ s� d Z ddlmZ ddlZddlZddlZddlmZ ddlm Z ddl mZmZ ddl mZ ddlmZ d d lmZ d dlmZ d dlmZ d d lmZ d dlmZmZmZmZ er�ddlmZ ddlm Z ddl!m"Z" d dl#m$Z$ d dl%m&Z& dIddddd�dd�Z'G dd� de�Z(ddd �d!d"�Z)e dd#�d$d%�d&d'��Z*d(d)d*d+d,�d-d.�Z+dd/�d0d1d*dd2d3d4�d5d6�Z,d(d7d8�d9d:�Z-d(ddd;�d<d=�Z.ddd>�d?dd2d@d)dA�dBdC�Z/d7ddD�dEdF�Z0d7ddD�dGdH�Z1dS )JzmPrivate logic related to fields (the `Field()` function and `FieldInfo` class), and arguments to `Annotated`.� )�annotationsN)�copy)� lru_cache)� TYPE_CHECKING�Any)�PydanticUndefined)�PydanticUserError� )� _typing_extra)� ConfigWrapper)�extract_docstrings_from_cls)�Representation)�get_cls_type_hints_lenient�get_type_hints�is_classvar�is_finalvar��BaseMetadata� �� FieldInfo�� BaseModel)�StandardDataclass)�DecoratorInfosFr zdict[str, Any] | None�boolzdict[str, Any])�obj�localns�include_extras�returnc C sJ t | dd�}d}|r:ztj| j}W n tk r8 Y nX t| |||d�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! � r( �H/opt/hc_python/lib/python3.8/site-packages/pydantic/_internal/_fields.py�get_type_hints_infer_globalns s r* c @ s e Zd ZdZdZdS )�PydanticMetadataz0Base class for annotation markers like `Strict`.r( N)�__name__r �__qualname__�__doc__� __slots__r( r( r( r) r+ <