
    ȅi              
           S r SSKrSSKJrJr  SSKJr  SSKJr  S/r	\" S5      r
\" S	5      r\" 5       r\" \R                  5      \4S
\\\
/\4   S\\
   S\S\4S jj5       rg)z 
Python polyfills for functools
    N)CallableIterable)TypeVar   )substitute_in_graphreduce_T_Ufunctioniterableinitialreturnc                    [        U5      nU[        L a   [        U5      nOUnU H  nU " XE5      nM     U$ ! [         a    [	        S5      S ef = f)Nz0reduce() of empty iterable with no initial value)iter_initial_missingnextStopIteration	TypeError)r   r   r   itvalueelements         [/home/james-whalen/.local/lib/python3.13/site-packages/torch/_dynamo/polyfills/functools.pyr   r      sl     
hB ""	HE (  L  	B	s	   7 A)__doc__	functoolscollections.abcr   r   typingr   
decoratorsr   __all__r	   r
   objectr   r        r   <module>r"      s     .  , * T]T] 8  Y%%& #Bx|$rl 
  'r!   