+
    Bi#                     P   ^ RI t ^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIH	t	 ^ RI
Ht ]P                  ! R4      t]P                  ! R4      t]P                  ! R	4      t ! R
 R] P                   4      t ! R R]P$                  4      t ! R R]P$                  4      t ! R R]P$                  4      t]	P,                  ! 4        ! R R]P$                  4      4       t ! R R]P$                  4      t ! R R]P$                  4      t]R8X  d   ]P6                  ! 4        R# R# )    N)support)import_helper)	os_helper)threading_helper)assert_python_failure_testlimitedcapi	_testcapi_testinternalcapic                   P    ] tR t^t^ t^t^t^t^t^t	^t
^t^t^	t]^,           tRtR# )Constant N)__name__
__module____qualname____firstlineno__Py_CONSTANT_NONEPy_CONSTANT_FALSEPy_CONSTANT_TRUEPy_CONSTANT_ELLIPSISPy_CONSTANT_NOT_IMPLEMENTEDPy_CONSTANT_ZEROPy_CONSTANT_ONEPy_CONSTANT_EMPTY_STRPy_CONSTANT_EMPTY_BYTESPy_CONSTANT_EMPTY_TUPLEINVALID_CONSTANT__static_attributes__r       1/usr/lib/python3.14/test/test_capi/test_object.pyr   r      sH    "#O.2r   r   c                   2   a  ] tR t^ t o R tR tR tRtV tR# )GetConstantTestc                   V P                  V! \        P                  4      R 4       V P                  V! \        P                  4      R4       V P                  V! \        P                  4      R4       V P                  V! \        P
                  4      \        4       V P                  V! \        P                  4      \        4       \        P                  \        ^ 3\        P                  \        ^3\        P                  \        R3\        P                  \        R3\        P                   \"        R33 F]  w  r#pV P%                  VR7      ;_uu_ 4        V! V4      pV P'                  \)        V4      W54       V P'                  WT4       R R R 4       K_  	  V P+                  \,        4      ;_uu_ 4        V! \        P.                  4       R R R 4       R #   + '       g   i     K  ; i  + '       g   i     R # ; i)NFT r   )constant_idr   )assertIsr   r   r   r   r   Ellipsisr   NotImplementedr   intr   r   strr   bytesr   tuplesubTestassertEqualtypeassertRaisesSystemErrorr   )selfget_constantr$   constant_typevalueobjs   &&    r   check_get_constant"GetConstantTest.check_get_constant!   sj   l8#<#<=tDl8#=#=>Fl8#<#<=tDl8#@#@A8Ll8#G#GH.Y &&Q/%%sA.++S"5--uc:--ub92
-K +66";/  cM?  , 762
 {++223 ,+ 766
 ,++s   5G5G*G'*G;	c                D    V P                  \        P                  4       R # N)r6   r   r2   r1   s   &r   test_get_constant!GetConstantTest.test_get_constant7   s     0 = =>r   c                D    V P                  \        P                  4       R # r9   )r6   r   get_constant_borrowedr:   s   &r   test_get_constant_borrowed*GetConstantTest.test_get_constant_borrowed:   s     0 F FGr   r   N)	r   r   r   r   r6   r;   r?   r   __classdictcell____classdict__s   @r   r!   r!       s     4,?H Hr   r!   c                   8   a  ] tR t^>t o R tR tR tR tRtV t	R# )	PrintTestc                F    ! R  R4      pV! 4       p\         P                  pV P                  \         P                  V4       \        P                  W#R4       \        VR4      ;_uu_ 4       pV P                  VP                  4       \        V4      4       RRR4       \        P                  W#R4       \        VR4      ;_uu_ 4       pV P                  VP                  4       \        V4      4       RRR4       R#   + '       g   i     Ln; i  + '       g   i     R# ; i)c                   ,   a  ] tR t^At o R tR tRtV tR# ):PrintTest.testPyObjectPrintObject.<locals>.PrintableObjectc                    R # )zspam spam spamr   r:   s   &r   __repr__CPrintTest.testPyObjectPrintObject.<locals>.PrintableObject.__repr__C   s    'r   c                    R # )zegg egg eggr   r:   s   &r   __str__BPrintTest.testPyObjectPrintObject.<locals>.PrintableObject.__str__F   s    $r   r   N)r   r   r   r   rJ   rM   r   rA   rB   s   @r   PrintableObjectrH   A   s     (% %r   rO   FrNT)r   TESTFN
addCleanupunlinkr	   call_pyobject_printopenr-   readreprr)   )r1   rO   r5   output_filenameoutput_files   &    r   testPyObjectPrintObject!PrintTest.testPyObjectPrintObject?   s    	% 	% #**	((/: 	%%cEB/3'';[--/c; ( 	%%cDA/3'';[--/S: (' ('
 (''s   ,*C<*D<D	D 	c                2   \         P                  pV P                  \         P                  V4       \        P                  V4       \        VR 4      ;_uu_ 4       pV P                  VP                  4       R4       RRR4       R#   + '       g   i     R# ; i)rP   z<nil>N)	r   rQ   rR   rS   r	   pyobject_print_nullrU   r-   rV   )r1   rX   rY   s   &  r   testPyObjectPrintNULLPrintTest.testPyObjectPrintNULLW   sh    #**	((/: 	%%o6/3'';[--/9 ('''   !BB	c                2   \         P                  pV P                  \         P                  V4       \        P                  V4      p\        VR 4      ;_uu_ 4       pV P                  VP                  4       V4       RRR4       R#   + '       g   i     R# ; i)rP   N)	r   rQ   rR   rS   r	   pyobject_print_noref_objectrU   r-   rV   )r1   rX   correct_outputrY   s   &   r   testPyObjectPrintNoRefObject&PrintTest.testPyObjectPrintNoRefObject`   sj    #**	((/: #>>O/3'';[--/@ ('''r`   c                8   \         P                  pV P                  \         P                  V4       \	        VR 4      P                  4        V P                  \        4      ;_uu_ 4        \        P                  V4       RRR4       R#   + '       g   i     R# ; i)zw+N)
r   rQ   rR   rS   rU   closer/   OSErrorr	   pyobject_print_os_error)r1   rX   s   & r   testPyObjectPrintOSError"PrintTest.testPyObjectPrintOSErrori   sb    #**	((/:_d#))+w''--o> ('''s   (BB	r   N)
r   r   r   r   rZ   r^   rd   rj   r   rA   rB   s   @r   rE   rE   >   s     ;0:A? ?r   rE   c                   0   a  ] tR t^rt o RtR tR tRtV tR# )ClearWeakRefsNoCallbacksTestz/Test PyUnstable_Object_ClearWeakRefsNoCallbacksc                R  a ^ RI p^ RIp ! R R4      pV! 4       p. oVP                  VV3R l4      pV P                  V! 4       V4       V P	                  S4       \
        P                  V4       V P                  V! 4       4       VP                  4        V P	                  S4       R# )z7Ensure PyUnstable_Object_ClearWeakRefsNoCallbacks worksNc                       ] tR t^xtRtR# )EClearWeakRefsNoCallbacksTest.test_ClearWeakRefsNoCallbacks.<locals>.Cr   N)r   r   r   r   r   r   r   r   Crp   x   s    r   rq   c                  &   < S P                  R 4      # )zdon't add this)append)messagess   r   <lambda>LClearWeakRefsNoCallbacksTest.test_ClearWeakRefsNoCallbacks.<locals>.<lambda>|   s    x7G'Hr   )	weakrefgcrefr%   assertFalser	   $pyobject_clear_weakrefs_no_callbacksassertIsNonecollect)r1   rw   rx   rq   r5   ry   rt   s   &     @r   test_ClearWeakRefsNoCallbacks:ClearWeakRefsNoCallbacksTest.test_ClearWeakRefsNoCallbackst   s    	 	ckk#HIceS!"66s;#% 


"r   c                    ^ RI p\        4       pV P                  \        4      ;_uu_ 4        VP	                  V4      pRRR4       \
        P                  V4       R#   + '       g   i     L'; i)z1Don't fail on objects that don't support weakrefsN)rw   objectr/   	TypeErrorry   r	   r{   )r1   rw   r5   ry   s   &   r   0test_ClearWeakRefsNoCallbacks_no_weakref_supportMClearWeakRefsNoCallbacksTest.test_ClearWeakRefsNoCallbacks_no_weakref_support   sG    hy))++c"C *66s; *)s   AA-	r   N)	r   r   r   r   __doc__r~   r   r   rA   rB   s   @r   rm   rm   r   s     9# < <r   rm   c                   T   a  ] tR t^t o Rt]P                  ! R4      R 4       tRtV t	R# )EnableDeferredRefcountingTestz-Test PyUnstable_Object_EnableDeferredRefcountcpuc                  a  ^ RI Hp S P                  \        P	                  R4      ^ 4       . pS P                  \        P	                  V4      \        \        P                  4      4       S P                  V. 4       \        P                  '       d%   S P                  \        P                  V4      4       V 3R lp. ROp\        ^4       Uu. uF  qQ! W43R7      NK  	  pp\        P                  ! V4      ;_uu_ 4        \        ^
4       F  pVP                  V4       K  	  RRR4       \        P                  '       d'   S P                  \        P                  V4      4       R# R# u upi   + '       g   i     LS; i)r   )Threadznot trackedc                 R   < SP                  \        P                  V 4      R4       R# )r   N)r      )assertInr	   !pyobject_enable_deferred_refcount)r5   r1   s   &r   
silly_funcOEnableDeferredRefcountingTest.test_enable_deferred_refcount.<locals>.silly_func   s     MM;;C@r   )targetargsN)r         )	threadingr   r-   r	   r   r(   r   Py_GIL_DISABLED
assertTruer
   has_deferred_refcountranger   start_threadsrs   )r1   r   foor   
silly_list_threadsis   f       r   test_enable_deferred_refcount;EnableDeferredRefcountingTest.test_enable_deferred_refcount   s#   $DD]SUVWDDSI3wOfOfKgh 	b!"""OO-CCCHI	 
CH8
CKaF*=98 	 
 ++G442Y!!!$  5 """OO-CCJOP #
 54s   E* $E//E?	r   N)
r   r   r   r   r   r   requires_resourcer   r   rA   rB   s   @r   r   r      s'     7u%Q &Qr   r   c                   *   a  ] tR t^t o RtR tRtV tR# )IsUniquelyReferencedTestz+Test PyUnstable_Object_IsUniquelyReferencedc                6   V P                  \        P                  \        4       4      4       V P                  \        P                  . 4      4       V P	                  \        P                  R 4      4       V P	                  \        P                  ^*4      4       R# )zspanish inquisitionN)r   r	   is_uniquely_referencedr   rz   r:   s   &r   test_is_uniquely_referenced4IsUniquelyReferencedTest.test_is_uniquely_referenced   se    	88BC	88<=99:OPQ99"=>r   r   N)r   r   r   r   r   r   r   rA   rB   s   @r   r   r      s     5? ?r   r   c                     a  ] tR t^t o R t]P                  ! ]! ]R4      R4      R 4       t	]P                  ! ]! ]R4      R4      ]
P                  ! RRRRR	7      R
 4       4       t]
P                  ! R4      R 4       tR tRtV tR# )CAPITestc                t    \         P                  ! V4      p\        R V4      w  r#pV P                  VR4       R# )z-csW   object\.c:[0-9]+: _Py_NegativeRefcount: Assertion failed: object has negative ref countN)textwrapdedentr   assertRegex)r1   codercouterrs   &&   r   check_negative_refcount CAPITest.check_negative_refcount   s7     t$,T48;	<r   negative_refcountz"need _testcapi.negative_refcount()c                ,    R pV P                  V4       R# )z
            import _testcapi
            from test import support

            with support.SuppressCrashReport():
                _testcapi.negative_refcount()
        Nr   r1   r   s   & r   test_negative_refcountCAPITest.test_negative_refcount   s     	$$T*r   decref_freed_objectz$need _testcapi.decref_freed_object()zuse after free on purposeT)addressmemoryubc                ,    R pV P                  V4       R# )z
            import _testcapi
            from test import support

            with support.SuppressCrashReport():
                _testcapi.decref_freed_object()
        Nr   r   s   & r   test_decref_freed_object!CAPITest.test_decref_freed_object   s    
 	$$T*r   r   c                   a ^ RI o ! V3R lR4      p\        R4       F  pV! 4       p\        P                  V4       K!  	  R# )r   Nc                   .   <a  ] tR t^t o V3R ltRtV tR# )+CAPITest.test_decref_delayed.<locals>.MyObjc                (   < SP                  4        R # r9   )r}   )r1   rx   s   &r   __del__3CAPITest.test_decref_delayed.<locals>.MyObj.__del__   s    

r   r   N)r   r   r   r   r   r   rA   )rC   rx   s   @r   MyObjr      s      r   r   i  )rx   r   r
   incref_decref_delayed)r1   r   r   r5   rx   s   &   @r   test_decref_delayedCAPITest.test_decref_delayed   s7     		 	 tA'C33C8 r   c                   a  S P                  \        P                  \        4       4      4       \        4       pS P	                  \        P                  V4      4       V 3R  lpV! \        4       4       R# )c                    < SP                  \        P                  ! V 4      ^4       SP                  \        P                  V 4      4       R# )r   N)r-   sysgetrefcountrz   r	   pyobject_is_unique_temporary)xr1   s   &r   func/CAPITest.test_is_unique_temporary.<locals>.func   s5    S__Q/3YCCAFGr   N)r   r	   r   r   rz   )r1   r5   r   s   f  r   test_is_unique_temporary!CAPITest.test_is_unique_temporary   sM    	>>vxHIh??DE	H
 	VXr   r   N)r   r   r   r   r   unittest
skipUnlesshasattrr	   r   r   skip_if_sanitizerr   r   r   r   r   rA   rB   s   @r   r   r      s     < ,?@=?+?+ ,AB?A:'+DTC+CA+ u%9 &9
 
r   r   __main__)enumr   r   r   testr   test.supportr   r   r   test.support.script_helperr   import_moduler   r	   r
   IntEnumr   TestCaser!   rE   rm   requires_working_threadingr   r   r   r   mainr   r   r   <module>r      s
    
    & " ) < !../AB ''4	!//0CD 3t|| 3Hh'' H<1?!! 1?h<8#4#4 <6 ,,. QH$5$5  Q / QF?x00 ?=x   =~ zMMO r   