
    ڏDj4                         d dl Z d dlZ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y)	    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y)TestBuiltinReturnTypesc                 2   t         j                  dk\  }t        j                         D ]  \  }}t	        t
        |dk7  r|nd      }|j                         D ]  \  }}t        j                  |      j                  }t        ||      }|j                  r`d|v r|j                  d      d   }|dk(  r|}| j                  |j                  |       |s{| j                  t        ||      | d|        | j                  |j!                  d	      |         y )
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	            eC:\Crop_Prediction\Backend\crop-ai-system\venv\Lib\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"D"F 	gIwhY)5K	QVWG18 g--,33I>CC@{[....+;+E+Ec+J1+M('3.+4($$[%5%57GH&(E)TUVaUbGcd$$[%G%Gd%G%SUefg	g    N)__name__
__module____qualname__r.    r/   r-   r   r      s    gr/   r   c                       e Zd Zd Zd Zy)TestBuiltinCompatibilityc                    t        t              }t        j                  dk7  r|j	                  d       t        j                  t        j                  ddgdd      }t        d t        j                  |j                        D              }t        j                  t        k  rD||z
  }|r,| j                  d	d
j                  t!        |                    | j                  d       | j#                  ||       y )Nwin32WindowsErrorz-czGimport builtins, json, sys; sys.stdout.write(json.dumps(dir(builtins)))Tutf8)capture_outputencodingc              3   (   K   | ]
  }|d vr|  yw))__doc__
__loader__r0   __package____spec__Nr3   ).0r    s     r-   	<genexpr>zMTestBuiltinCompatibility.test_python_builtin_compatibility.<locals>.<genexpr>5   s#      %][[ %]s   z=skipping test, older Python release found. Missing builtins: z, z*skipping test, older Python release found.)setr
   r   platformdiscard
subprocessrun
executable	frozensetjsonloadsstdoutr   r	   skipTestjoinsortedassertSetEqual)r$   expected_builtinsoutputruntime_builtinsmissing_builtinss        r-   !test_python_builtin_compatibilityz:TestBuiltinCompatibility.test_python_builtin_compatibility*   s     56<<7"%%n5 ^^T#lm

 % %]!ZZ6%] ] ;;03CC ]^b^g^ghno  iA  _B  ^C  D  EMMFG,.?@r/   c                 >   t        j                         D ]  \  }}| j                  |t               t	        t
        |      }t        t        |         }| j                  |j                  |             |D ]$  }t	        ||d      }|| j                  ||       &  y)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   assertIsInstancerC   r   r   rO   r   assertFalse
differenceassertIn)r$   builtin_type_nameunsafe_methodsr+   known_methodsr)   builtin_methods          r-    test_unsafe_compile_time_methodsz9TestBuiltinCompatibility.test_unsafe_compile_time_methods@   s     2M1R1R1T 	-~!!.#6"8->?L",->?AM ^66}EF, !({D!I!)MM+~>		r/   N)r0   r1   r2   rU   r_   r3   r/   r-   r5   r5   )   s    A,r/   r5   )r   rJ   rF   r   unittestBuiltinr   r   r   r   r   Coder	   r
   TestCaser   r5   r3   r/   r-   <module>rd      sI       
  gX.. g0)x00 )r/   