
    oVh                    ,   U d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	m
Z
 d dlmZ i Zded<   eZ eee	      Zd
 Zd Z G d d      Z G d d      Z G d de      Z G d de      Z G d de      Zd Zd Zd Zd Zd Zd Zd Zd Z	 d Zd Z y )!    )annotations)Any)dispatch)AmbiguityWarning)raiseswarns)partialzdict[str, Any]test_namespace	namespacec                     t        t              d        t        t              d        } t        t              d         d      dk(  sJ  | d      dk(  sJ  d      dk(  sJ t        t        fd	      sJ y )
Nc                    | dz   S N    xs    V/home/dcms/DCMS/lib/python3.12/site-packages/sympy/multipledispatch/tests/test_core.pyfztest_singledispatch.<locals>.f       1u    c                    | dz   S N   r   r   s    r   gztest_singledispatch.<locals>.g   r   r   c                    | dz
  S r   r   r   s    r   r   ztest_singledispatch.<locals>.f   r   r   r   r            ?r   c                       d      S )Nhellor   r   s   r   <lambda>z%test_singledispatch.<locals>.<lambda>    s    qz r   )r   intfloatr   NotImplementedError)r   r   s    @r   test_singledispatchr&      s    c]  c]  e_  Q4199Q4199S6Q;;%'9:::r   c                     t        t        t              d        } t        t        t              d        }  | dd      dk(  sJ  | dd      dk(  sJ y )	Nc                    | |z   S Nr   r   ys     r   r   z test_multipledispatch.<locals>.f$   r   r   c                    | |z
  S r)   r   r*   s     r   r   z test_multipledispatch.<locals>.f(   r   r   r   r   r   r   g       @g      )r   r#   r$   r!   s    r   test_multipledispatchr-   #   s^    c3  eU  Q7a<<S#;$r   c                      e Zd Zy)AN__name__
__module____qualname__r   r   r   r/   r/   0       r   r/   c                      e Zd Zy)BNr0   r   r   r   r6   r6   1   r4   r   r6   c                      e Zd Zy)CNr0   r   r   r   r8   r8   2   r4   r   r8   c                      e Zd Zy)DNr0   r   r   r   r:   r:   3   r4   r   r:   c                      e Zd Zy)ENr0   r   r   r   r<   r<   4   r4   r   r<   c                     t        t              d        } t        t              d        }  | t                     dk(  sJ  | t                     dk(  sJ  | t                     dk(  sJ y )Nc                     y)Nar   r   s    r   r   ztest_inheritance.<locals>.f8       r   c                     y)Nbr   r   s    r   r   ztest_inheritance.<locals>.f<   r@   r   r?   rB   )r   r/   r6   r8   r!   s    r   test_inheritancerC   7   sh    a[  a[  QS6S==QS6S==QS6S==r   c                     t        t        t              d         t        t        t              d           t               t                     t        t        fk(  sJ   t               t                     t        t        fk(  sJ   t               t                     dk(  sJ   t               t                     dk(  sJ t	        t
         fd      sJ y )Nc                .    t        |       t        |      fS r)   )typer*   s     r   r   z1test_inheritance_and_multiple_dispatch.<locals>.fF   s    AwQr   c                     y)Nr   r   r*   s     r   r   z1test_inheritance_and_multiple_dispatch.<locals>.fJ       r   r   c                 6      t               t                     S r)   )r6   r!   s   r   r"   z8test_inheritance_and_multiple_dispatch.<locals>.<lambda>R   s    qac{ r   )r   r/   r6   r8   r   r%   r!   s   @r   &test_inheritance_and_multiple_dispatchrJ   E   s    a^    a^  QS!#;1a&   QS!#;1a&   QS!#;!QS!#;!%':;;;r   c                     t        t              d        } t        t              d        }  | t                     dk(  sJ y )Nc                     yr   r   r   s    r   hz#test_competing_solutions.<locals>.hV   rH   r   c                     yr   r   r   s    r   rM   z#test_competing_solutions.<locals>.hZ   rH   r   r   )r   r/   r8   r:   rM   s    r   test_competing_solutionsrP   U   sD    a[  a[  QS6Q;;r   c                     t        t        t              d        } t        t        t              d        }  | t	               t                     dk(  sJ y )Nc                     yr   r   r*   s     r   rM   z"test_competing_multiple.<locals>.hb   rH   r   c                     yr   r   r*   s     r   rM   z"test_competing_multiple.<locals>.hf   rH   r   r   )r   r/   r6   r8   r:   rO   s    r   test_competing_multiplerT   a   sN    a^  a^  QS!#;!r   c                 N   i } t        t        |       } |t        t              d        }t	        t
        d      5   |t        t              d        }d d d         |t               t                      |t               t                     cxk(  rdk(  sJ  J y # 1 sw Y   HxY w)Nr   c                     yr   r   r*   s     r   r   z#test_competing_ambiguous.<locals>.fq   rH   r   F)test_stacklevelc                     yr   r   r*   s     r   r   z#test_competing_ambiguous.<locals>.fv       r   r   )r	   orig_dispatchr/   r8   r   r   )r
   r   r   s      r   test_competing_ambiguousr[   m   s    N}?Ha^  
	7 	!Q	 
	
 QS!#;!AC+****** s   BB$c                     t        t              d        }  | t                     dk(  sJ t        t              d        }  | t                     dk(  sJ y )Nc                     yr   r   r   s    r   r   z(test_caching_correct_behavior.<locals>.f   rH   r   r   c                     yr   r   r   s    r   r   z(test_caching_correct_behavior.<locals>.f   rH   r   r   r   r/   r8   r!   s    r   test_caching_correct_behaviorr`   ~   sV    a[  QS6Q;;a[  QS6Q;;r   c                     t        t        t        f      d        }  | t                     dk(  sJ  | t                     dk(  sJ y )Nc                     yr   r   r   s    r   r   ztest_union_types.<locals>.f   rH   r   r   r_   r!   s    r   test_union_typesrc      sC    q!f  QS6Q;;QS6Q;;r   c                     i } i }d } t        t        |       |      }d } t        t        |      |      } |d      dk(  sJ  |d      dk(  sJ y )Nc                     yr   r   r   s    r   fooztest_namespaces.<locals>.foo       r   r   c                     yr   r   r   s    r   rf   ztest_namespaces.<locals>.foo   rg   r   r   r   r   )rZ   r#   )ns1ns2rf   foo1foo2s        r   test_namespacesrm      s\    
C
C,=,S1D,=,S1D7a<<7a<<r   c                      G d d      }  |        }|j                  d      dk(  sJ |j                  d      dk(  sJ |j                  d      dk(  sJ y )Nc                  `    e Zd Z ee      d        Z ee      d        Z ee      d        Zy)test_methods.<locals>.Fooc                    |dz
  S r   r   selfr   s     r   r   ztest_methods.<locals>.Foo.f       q5Lr   c                    |dz   S r   r   rr   s     r   r   ztest_methods.<locals>.Foo.f   rt   r   c                    |dz   S )Nr   r   rr   s     r   r   ztest_methods.<locals>.Foo.g   rt   r   N)r1   r2   r3   r   r$   r   r#   r   r   r   r   Foorp      sH    	%	 
	 
#	 
	 
#	 
	r   rw   r   r   r   g           )r   r   rw   rf   s     r   test_methodsrz      sS      %C558q==55:558q==r   c                     G d d      }  |        }|j                  t               t                     dk(  sJ |j                  t               t                     dk(  sJ |j                  t               t                     dk(  sJ y )Nc                  H    e Zd Z eee      d        Z eee      d        Zy)+test_methods_multiple_dispatch.<locals>.Fooc                     yr   r   r*   s     r   r   z-test_methods_multiple_dispatch.<locals>.Foo.f   rY   r   c                     yr   r   r*   s     r   r   z-test_methods_multiple_dispatch.<locals>.Foo.f   rY   r   N)r1   r2   r3   r   r/   r   r8   r   r   r   rw   r}      s4    	!Q	 
	 
!Q	 
	r   rw   r   r   )r   r/   r8   ry   s     r   test_methods_multiple_dispatchr      si      %C55ac?a55ac?a55ac?ar   N)!
__future__r   typingr   sympy.multipledispatchr   sympy.multipledispatch.conflictr   sympy.testing.pytestr   r   	functoolsr	   r
   __annotations__rZ   r&   r-   r/   r6   r8   r:   r<   rC   rJ   rP   rT   r[   r`   rc   rm   rz   r   r   r   r   <module>r      s    "  + < . !# #8~6;(
        < 		+" 
* r   