
    -Ph}                         d dl Z d dlZd dlZddlmZmZmZmZmZ ddl	m
Z
mZ  G d dej                  Z G d dej                  ZdS )	    N   )inferred_method_return_types"find_return_type_of_builtin_methodunsafe_compile_time_methodsis_safe_compile_time_methodbuiltin_scope)KNOWN_PYTHON_BUILTINS_VERSIONKNOWN_PYTHON_BUILTINSc                       e Zd Zd ZdS )TestBuiltinReturnTypesc                 Z   t           j        dk    }t          j                    D ]\  }}t	          t
          |dk    r|nd          }|                                D ]\  }}t          j        |          j        }t          ||          }|j
        rnd|v r|                    d          d         }|dk    r|}|                     |j        |           |r)|                     t          ||          | d|            |                     |                    d	          |           ΐd S )
N)   
   unicodestr[r   T.T)pyrex)sysversion_infor   itemsgetattrbuiltinsr   lookuptyper   is_builtin_type	partitionassertEqualname
assertTruehasattrempty_declaration_code)	selflook_up_methods	type_namemethodspy_typemethod_namereturn_type_namebuiltin_typereturn_types	            a/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/Cython/Compiler/Tests/TestBuiltin.py'test_find_return_type_of_builtin_methodz>TestBuiltinReturnTypes.test_find_return_type_of_builtin_method   s]   *f4">"D"F"F 	g 	gIwhY)5K5K		QVWWG18 g g--,3I>>C@{[[. 	g...+;+E+Ec+J+J1+M('3..+4($$[%57GHHH& e(E(E)GcGcVaGcGcddd$$[%G%Gd%G%S%SUeffffg	g 	g    N)__name__
__module____qualname__r.    r/   r-   r   r      s(        g g g g gr/   r   c                       e Zd Zd Zd ZdS )TestBuiltinCompatibilityc                    t          t                    }t          j        dk    r|                    d           t          d t          t                    D                       }t          j        t          k     rT||z
  }|r8| 
                    dd                    t          |                                | 
                    d           |                     ||           d S )Nwin32WindowsErrorc              3   "   K   | ]
}|d v|V  dS ))__doc__
__loader__r0   __package____spec__Nr3   ).0r    s     r-   	<genexpr>zMTestBuiltinCompatibility.test_python_builtin_compatibility.<locals>.<genexpr>,   s>       %] %][[[ [[[[%] %]r/   z=skipping test, older Python release found. Missing builtins: z, z*skipping test, older Python release found.)setr
   r   platformdiscard	frozensetdirr   r   r	   skipTestjoinsortedassertSetEqual)r$   expected_builtinsruntime_builtinsmissing_builtinss       r-   !test_python_builtin_compatibilityz:TestBuiltinCompatibility.test_python_builtin_compatibility(   s    566<7""%%n555$ %] %] ]]%] %] %] ] ] ;;;03CC E  D^b^g^ghno  iA  iA  _B  _B  D  D  E  E  EMMFGGG,.?@@@@@r/   c                 z   t          j                    D ]\  }}|                     |t                     t	          t
          |          }t          t          |                   }|                     |	                    |                     |D ],}t	          ||d          }|| 
                    ||           ,-dS )zValidate the table of builtin methods that are not safe for compile time evaluation
        against the table of known builtin methods (and their types).
        N)r   r   assertIsInstancer@   r   r   rG   r   assertFalse
differenceassertIn)r$   builtin_type_nameunsafe_methodsr+   known_methodsr)   builtin_methods          r-    test_unsafe_compile_time_methodsz9TestBuiltinCompatibility.test_unsafe_compile_time_methods6   s     2M1R1T1T 	 	-~!!.#666"8->??L",->?A AM ^66}EEFFF,  !({D!I!I!)MM+~>>> *	 	r/   N)r0   r1   r2   rL   rV   r3   r/   r-   r5   r5   '   s5        A A A    r/   r5   )r   r   unittestBuiltinr   r   r   r   r   Coder	   r
   TestCaser   r5   r3   r/   r-   <module>r[      s     



                     g g g g gX. g g g0! ! ! ! !x0 ! ! ! ! !r/   