
    Ae                     b    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
mZmZ  G d de      Zy)	    )
ModuleNode)ModuleScope)TransformTest)MethodDispatcherTransform)NormalizeTreeAnalyseDeclarationsTransformAnalyseExpressionsTransformInterpretCompilerDirectivesc                   "    e Zd ZdZd Zd Zd Zy)TestMethodDispatcherTransformNc                     | j                   Hd }d }|t        |      t        |i       t        |      t	        |      g}| j                  |d      | _         | j                   S )Nc                 R    t        dd d       }t        | j                  d | |di       S )Ntest)docbodyscopefull_module_namedirective_comments)r   r   pos)noder   s     Alib/python3.12/site-packages/Cython/Compiler/Tests/TestVisitor.pyfake_modulez>TestMethodDispatcherTransform._build_tree.<locals>.fake_module   s/    #FD$7!$((4(-579 9    z
                cdef bytes s = b'asdfg'
                cdef dict d = {1:2}
                x = s * 3
                d.get('test')
            )_treer   r
   r   r	   run_pipeline)selfcontextr   pipelines       r   _build_treez)TestMethodDispatcherTransform._build_tree   sk    ::G9 g&+GR8,W5+G4H **8 6 DJ zzr   c                     dg G fddt               }| j                         }  |d       |       | j                  dd          y )Nr   c                       e Zd Z fdZy)?TestMethodDispatcherTransform.test_builtin_method.<locals>.Testc                 "    dxx   dz  cc<   |S )Nr       r   r   funcargsunboundcallss        r   _handle_simple_method_dict_getz^TestMethodDispatcherTransform.test_builtin_method.<locals>.Test._handle_simple_method_dict_get(   s    aAr   N)__name__
__module____qualname__r+   r*   s   r   Testr"   '   s    r   r0   r$   r   r   assertEqualr   r0   treer*   s      @r   test_builtin_methodz1TestMethodDispatcherTransform.test_builtin_method%   sI    	, 	
 !T
4E!H%r   c                     ddd G fddt               }| j                         }  |d       |       | j                  dd          | j                  dd          y )Nr   )bytesobjectc                   "    e Zd Z fdZ fdZy)=TestMethodDispatcherTransform.test_binop_method.<locals>.Testc                 "    dxx   dz  cc<   |S )Nr7   r$   r%   r&   s        r   #_handle_simple_method_bytes___mul__zaTestMethodDispatcherTransform.test_binop_method.<locals>.Test._handle_simple_method_bytes___mul__3   s    g!#r   c                 "    dxx   dz  cc<   |S )Nr8   r$   r%   r&   s        r   $_handle_simple_method_object___mul__zbTestMethodDispatcherTransform.test_binop_method.<locals>.Test._handle_simple_method_object___mul__6   s    h1$r   N)r,   r-   r.   r<   r>   r/   s   r   r0   r:   2   s    r   r0   r$   r7   r8   r1   r3   s      @r   test_binop_methodz/TestMethodDispatcherTransform.test_binop_method0   s`    q)	, 	 !T
4E'N+E(O,r   )r,   r-   r.   r   r   r5   r?   r%   r   r   r   r   
   s    E0	&-r   r   N)Cython.Compiler.ModuleNoder   Cython.Compiler.Symtabr   Cython.TestUtilsr   Cython.Compiler.Visitorr   #Cython.Compiler.ParseTreeTransformsr   r   r	   r
   r   r%   r   r   <module>rE      s'    1 . * => >
3-M 3-r   