Viewing File: /opt/hc_python/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_fields.cpython-312.pyc
�
e��gV: � � � d Z ddlmZ ddlZddlZddlZddlmZ ddlm Z ddl
mZmZ ddl
mZ ddlmZ d d
lmZ d dlmZ d dlmZ d d
lmZ d dlmZmZmZmZ erddlmZ ddlm Z ddl!m"Z" d dl#m$Z$ d dl%m&Z& d$ d%d�Z' G d� de� Z(d&d�Z) e d�� d'd�� Z*d(d�Z+dd� d)d�Z,d*d�Z-d+d�Z.ddd � d,d!�Z/d-d"�Z0d-d#�Z1y).zmPrivate 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)�DecoratorInfosc � � t | dd� }d}|r t j | j }t | |||�� S # t $ r Y �w xY w)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)�globalns�localns�include_extras)�getattr�sys�modules�__dict__�KeyErrorr )�objr r �module_namer s �I/opt/hc_python/lib/python3.12/site-packages/pydantic/_internal/_fields.py�get_type_hints_infer_globalnsr) s[ � �$ �#�|�T�2�K�&*�H�� ��{�{�;�/�8�8�H� �#��'�R`�a�a�� � �� �s �? � A�
Ac � � e Zd ZdZdZy)�PydanticMetadataz0Base class for annotation markers like `Strict`.� N)�__name__r �__qualname__�__doc__� __slots__r, � r( r+ r+ <