
    ^i                         S r SSKrSSKr\" \S5      (       a  \R                  rg\R
                  r\R                  r " S S\5      rg)zBackport of @functools.singledispatchmethod to Python <3.7.

Adapted from https://github.com/ikalnytskyi/singledispatchmethod
removing 2.7 specific code.
    Nsingledispatchmethodc            	          \ rS rSrSrS\R                  S\R                  4   SS4S jr SS\R                  S\R                  4   S	\R                  \R                  S\R                  4      S\R                  S\R                  4   4S
 jjr
S\R                  S\R                  \R                  /\R                  4   S\R                  S\R                  4   4S jr\S\R                  4S j5       rSrg)r      a  Single-dispatch generic method descriptor.

TODO: Figure out how to type this:

`mypy --strict` returns errors like the following for all decorated methods:
"Untyped decorator makes function "send" untyped."

But this is not a normal function-base decorator, it's a class and it
doesn't have a __call__ method. When decorating the "base" method
__init__ is called, but of course its return type is None.
func.returnNc                     [        U5      (       d+  [        US5      (       d  [        SR                  U5      5      e[	        U5      U l        Xl        g )N__get__z${!r} is not callable or a descriptor)callablehasattr	TypeErrorformatsingledispatch
dispatcherr   )selfr   s     H/home/james-whalen/.local/lib/python3.13/site-packages/socksio/compat.py__init__singledispatchmethod.__init__!   s?    D>>'$	*B*B F M Md STT,T2DOI    clsmethodc                 4    U R                   R                  XS9$ )a~  Register a method on a class for a particular type.

Note in Python <= 3.6 this methods cannot infer the type from the
argument's type annotation, users *must* supply it manually on
decoration, i.e.

@my_method.register(TypeToDispatch)
def _(self, arg: TypeToDispatch) -> None:
    ...

Versus in Python 3.7+:

@my_method.register
def _(self, arg: TypeToDispatch) -> None:
    ...

)r   )r   register)r   r   r   s      r   r   singledispatchmethod.register(   s    4 ??++C+==r   objc                    ^ ^^ S[         R                  S[         R                  S[         R                  4UUU 4S jjnT R                  Ul        T R                  Ul        [	        UT R
                  5        U$ )Nargskwargsr   c                     > TR                   R                  U S   R                  5      nUR                  TT5      " U 0 UD6$ )Nr   )r   dispatch	__class__r	   )r   r   r   r   r   r   s      r   _method-singledispatchmethod.__get__.<locals>._methodG   s<    11$q'2C2CD~~c3/@@@r   )typingAny__isabstractmethod__r   update_wrapperr   )r   r   r   r!   s   ``` r   r	   singledispatchmethod.__get__D   sb    Avzz AVZZ AFJJ A A ,0+D+DG(#}}G7DII.Nr   c                 0    [        U R                  SS5      $ )Nr%   F)getattrr   )r   s    r   r%   )singledispatchmethod.__isabstractmethod__T   s    499&<eDDr   )r   r   )N)__name__
__module____qualname____firstlineno____doc__r#   Callabler$   r   Optionalr   r	   propertyr%   __static_attributes__ r   r   r   r      s    
		fjj!A 	d 	 IM	>fjj1	> OOFOOCO$DE	> __S&**_-		>8	zz	(.fjj8P(Q	__S&**_-	  
	E&** 	E 
	Er   )r/   	functoolsr#   r   r   r&   r   objectr4   r   r   <module>r7      sR     
9,--$99--N--NBEv BEr   