o
    Ô°“iß  ã                   @  s0   d dl mZ ddlmZ ddd	„Zddd„ZdS )é    )Úannotationsé   )Ú
StructMetaÚobjÚobjectÚreturnÚboolc                 C  s   t t| ƒtƒS )a  Check whether ``obj`` is a `msgspec.Struct`-like instance.

    Parameters
    ----------
    obj:
        Object to check.

    Returns
    -------
    bool
        `True` if ``obj`` is an instance of a class whose metaclass is
        `msgspec.StructMeta` (or a subclass of it), and `False` otherwise.
        Static type checkers treat a successful ``is_struct(obj)`` check as
        narrowing ``obj`` to `msgspec.Struct` within the true branch, even if
        the runtime class does not literally inherit `msgspec.Struct`.
    )Ú
isinstanceÚtyper   )r   © r   úI/home/ubuntu/.local/lib/python3.10/site-packages/msgspec/_typing_utils.pyÚ	is_struct   s   r   Útpc                 C  s
   t | tƒS )aÔ  Check whether ``tp`` is a `msgspec.Struct`-like class.

    Parameters
    ----------
    tp:
        Object to check, typically a class object.

    Returns
    -------
    bool
        `True` if ``tp`` is a class whose metaclass is `msgspec.StructMeta`
        (or a subclass of it), and `False` otherwise. Static type checkers
        treat a successful ``is_struct_type(tp)`` check as narrowing
        ``tp`` to `type[msgspec.Struct]` within the true branch.
    )r	   r   )r   r   r   r   Úis_struct_type   s   
r   N)r   r   r   r   )r   r   r   r   )Ú
__future__r   Ú r   r   r   r   r   r   r   Ú<module>   s    
