ó
    °"³jQ  ã                   ó  • S r SSKJr  SSKJrJrJrJrJr  SSK	J
r
Jr  \" SSS9r  " S S	\\   5      r\
" S
\\\      \\   -  \4S9r S\\   S\\   4S jr\ " S S\\   5      5       r\
" S\\   S-  \4S9r S\S\4S jrg)zýUtility types and functions for type manipulation and introspection.

This module provides helper classes and functions for working with Python's type system,
including workarounds for type checker limitations and utilities for runtime type inspection.
é    )Ú	dataclass)ÚAnyÚGenericÚcastÚget_argsÚ
get_origin)ÚTypeAliasTypeÚTypeVarÚTT)Úinfer_variancec                   ó   • \ rS rSrSrSrg)ÚTypeExpressioné   a=  A workaround for type checker limitations when using complex type expressions.

    This class serves as a wrapper for types that cannot normally be used in positions
requiring `type[T]`, such as `Any`, `Union[...]`, or `Literal[...]`. It provides a
    way to pass these complex type expressions to functions expecting concrete types.

Example:
        Instead of `output_type=Union[str, int]` (which may cause type errors),
        use `output_type=TypeExpression[Union[str, int]]`.

Note:
        This is a workaround for the lack of TypeForm in the Python type system.
© N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__static_attributes__r   ó    ÚP/home/mande/repo/quber/.venv/lib/python3.13/site-packages/pydantic_graph/util.pyr   r      s   † ñò 	r   r   ÚTypeOrTypeExpression)Útype_paramsÚtype_Úreturnc                 óp   • [        U 5      [        L a  [        U 5      S   $ [        [        [
           U 5      $ )zãExtract the actual type from a TypeExpression wrapper or return the type directly.

Args:
    type_: Either a direct type or a TypeExpression wrapper.

Returns:
    The unwrapped type, ready for use in runtime type operations.
r   )r   r   r   r   Útyper   )r   s    r   Úunpack_type_expressionr   +   s1   € ô �%ÓœNÒ*Ü˜‹˜qÑ!Ð!Ü””Q‘˜ÓÐr   c                   ó$   • \ rS rSr% Sr\\S'   Srg)ÚSomeé9   a2  Container for explicitly present values in Maybe type pattern.

This class represents a value that is definitely present, as opposed to None.
It's part of the Maybe pattern, similar to Option/Maybe in functional programming,
allowing distinction between "no value" (None) and "value is None" (Some(None)).
Úvaluer   N)r   r   r   r   r   r   Ú__annotations__r   r   r   r   r!   r!   9   s   ‡ ñð ƒHÚr   r!   ÚMaybeNÚ	callable_c                 ó.   • [        U S[        U 5      5      $ )zäExtract a human-readable name from a callable object.

Args:
    callable_: Any callable object (function, method, class, etc.).

Returns:
    The callable's __name__ attribute if available, otherwise its string representation.
r   )ÚgetattrÚstr)r&   s    r   Úget_callable_namer*   Q   s   € ô �9˜j¬#¨i«.Ó9Ð9r   )r   Údataclassesr   Útypingr   r   r   r   r   Útyping_extensionsr	   r
   r   r   r   r   r   r!   r%   r)   r*   r   r   r   Ú<module>r.      s×   ðñõ "ß ;Õ ;ç 4áˆC Ñ%€Ø 3ô	�W˜Q‘Zô 	ñ$ %Ð%;¸TÀ.ÐQRÑBSÑ=TÐW[Ð\]ÑW^Ñ=^ÐmnÐlpÑqÐ ðð Ð"6°qÑ"9ð  ¸dÀ1¹gô  ð ô	ˆ7�1‰:ó 	ó ð	ñ 	�g˜t A™w¨™~¸A¸4Ñ@€ðð	: ð 	:¨õ 	:r   