
    Ki                        d Z ddlmZ ddlZddlmZ ddlmZmZm	Z	  e	dd      Z
 G d	 d
ej                  ee
         Zy)zBase dependency class.    )annotationsN)TracebackType)AnyGenericTypeVarTT)	covariantc                  f    e Zd ZU dZdZded<   d	dZej                  d
d       Z		 	 	 	 	 	 	 	 ddZ
y)
Dependencya  Base class for all injectable dependencies.

    Subclasses implement ``__aenter__`` to produce the injected value and
    optionally ``__aexit__`` for cleanup. The resolution engine enters each
    dependency as an async context manager, so resources are cleaned up in
    reverse order when the call completes.

    Set ``single = True`` on a subclass to enforce that only one instance
    of that dependency type may appear in a function's signature.
    Fboolsinglec                    | S )zReturn a copy bound to a parameter's name and value.

        Called when the dependency appears as ``Annotated`` metadata.
        Subclasses override to capture context; the default returns *self*.
         )selfnamevalues      ]/home/jay/workspace/scripts/.codegraph-venv/lib/python3.12/site-packages/uncalled_for/base.pybind_to_parameterzDependency.bind_to_parameter   s	         c                   K   y wNr   )r   s    r   
__aenter__zDependency.__aenter__"   s	     %(   c                   K   y wr   r   )r   exc_type	exc_value	tracebacks       r   	__aexit__zDependency.__aexit__%   s      	r   N)r   strr   r   returnzDependency[T])r    r   )r   ztype[BaseException] | Noner   zBaseException | Noner   zTracebackType | Noner    None)__name__
__module____qualname____doc__r   __annotations__r   abcabstractmethodr   r   r   r   r   r   r      sY    	 FD 	( (, ( (	
 
r   r   )r%   
__future__r   r'   typesr   typingr   r   r   r   ABCr   r   r   r   <module>r-      s9     " 
  ( (C4 '!* r   